gpt4 book ai didi

xgboost - 警告 :/workspace/src/learner. cc:480:参数:{ scale_pos_weight } 可能未使用

转载 作者:行者123 更新时间:2023-12-04 13:34:05 29 4
gpt4 key购买 nike

clf = XGBClassifier(learning_rate =0.05,
n_estimators=300,
max_depth=10,
min_child_weight=1,
gamma=0.5,
reg_alpha=0,
reg_lambda=2,
subsample=0.8,
colsample_bytree=0.8,
scale_pos_weight=1,
objective='multi:softmax',
num_class=14,
nthread=20,
seed=1000)
xgb_param = clf.get_xgb_params()
xgTrain = xgb.DMatrix(x_train_, label=y_train_)

print ('Start cross validation')
cvresult = xgb.cv(xgb_param, xgTrain, num_boost_round=500, nfold=5, metrics=['mlogloss'],
early_stopping_rounds=5, stratified=True, seed=1000)


print('Best number of trees = {}'.format(cvresult.shape[0]))
clf.set_params(n_estimators=cvresult.shape[0])
print('Fit on the all_trainingsdata')
clf.fit(X_train,y_train,eval_metric=['mlogloss'])

WARNING: /workspace/src/learner.cc:480:Parameters: { scale_pos_weight } might not be used.


This may not be accurate due to some parameters are only used in language bindings butpassed down to XGBoost core. Or some parameters are not used but slip through thisverification. Please open an issue if you find above cases.


这是什么意思?
我的笔记本正在运行,它不断出现,我应该忽略这个还是做些什么来阻止它?

最佳答案

scale_pos_weight 是一个用于不平衡类的二元分类问题的参数。如果你只有几个正例和很多负例,它可以给正例更多的权重,这可以提高准确性。
您正在进行多类分类(如“multi:softmax”的目标所示),因此无法应用此参数。
您的笔记本将运行良好,您可以相信自己的结果。这只是一个警告。您可以通过删除调用中的 scale_pos_weight=1 参数来消除它。

关于xgboost - 警告 :/workspace/src/learner. cc:480:参数:{ scale_pos_weight } 可能未使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63258627/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com