xgboost 中出现警告

min*_*ral 7 python xgboost

我正在使用 xgboost 解决多分类问题。

但是,拟合 xgboost 模型时出现警告。

我的代码如下。我正在使用 xgboost 1.4.0

start = time.time()


xgb_model = xgboost.XGBClassifier(tree_method='gpu_hist', eta = 0.2, nrounds= 1000, 
                                  colsample_bytree=0.5, 
                                  metric='multi:softmax') 


hr_pred = xgb_model.fit(x_train, np.ravel(y_train, order='C')).predict(x_test)

print(classification_report(y_test, hr_pred))

print(time.time()-start)
Run Code Online (Sandbox Code Playgroud)

结果很好。但是这个警告弹出。

Parameters: { "metric", "nrounds" } 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 above cases.


UserWarning: Use subset (sliced data) of np.ndarray is not recommended because it will generate extra copies and increase memory consumption
  "because it will generate extra copies and increase " +
Run Code Online (Sandbox Code Playgroud)
  1. 就算不准确,我也不知道传给XGBoost核心是什么意思。
  2. 我在哪里使用了 ndarray 的子集?

mwh*_*hee 1

我意识到这是一个临时解决方案,但pip uninstall xgboost随后pip install xgboost==1.3.3对我有用。