我有如下代码示例(所有代码都非常庞大):
def my_xgb(train, validate, features, target,
eta=0.03, max_depth=7, subsample = 0.7, colsample_bytree = 0.7,
colsample_bylevel=1,lambdaX = 1, alpha=0, gamma=0, min_child_weight=0,
rate_drop = 0.2, skip_drop=0.5,
num_boost_round = 1000, early_stopping_rounds = 50,
debug=True, eval_metric= ["auc"], objective = "binary:logistic",
seed=2017, booster = "gbtree", tree_method="exact", grow_policy="depthwise")
这是计算XGBoost模型的函数示例,当我使用下面的代码时:
resHists = dict()
rang = range(4,15,2)
for x in rang:
score, trainPred, testPred, train_history, impFig, imp = run_xgb(X_train_XGB,
X_test_XGB,
X_XGB,
y_XGB,
max_depth=x,
early_stopping_rounds=50, debug=False)
resHists[x]=train_history
print(x, score)
fig, ax = plt.subplots(1, 2, figsize=(14,6))
for x in rang:
resHists[x][['trainAUC']].add_suffix('_'+str(x)).iloc[10:].plot(ax=ax[0])
resHists[x][['validAUC']].add_suffix('_'+str(x)).iloc[10:].plot(ax=ax[1])
plt.show()
我有如下错误:
[16:53:51] WARNING: C:/Users/Administrator/workspace/xgboost-win64_release_1.3.0/src/learner.cc:541:
Parameters: { early_stopping_rounds, lambdaX, num_boost_round, rate_drop, silent, skip_drop } might not be used.
This may not be accurate due to some parameters are only used in language bindings but
passed down to XGBoost core. Or some parameters are not used but slip through this
verification. Please open an issue if you find the above cases.
代码可以正常工作并计算所有内容,但我有这个警告,下面的导入警告没有帮助。这可能是因为参数名称拼写错误:{early_stopping_rounds,lambdaX,num_boost_round,rate_drop,silent,skip_drop}但它也是正确的拼写inf函数。我怎样才能摆脱这个警告
import warnings
warnings.filterwarnings("ignore")
warnings.simplefilter(action='ignore', category=FutureWarning)
这似乎是xgboost软件包发出的警告。如果你想压制,你可能想考虑一些类似的事情:
这是从他们的documentation中提取的
相关问题 更多 >
编程相关推荐