运行过程中报出以下错误:
ml.dmlc.xgboost4j.java.XGBoostError: [14:15:26] D:\a\xgboost\xgboost\src\objective\regression_obj.cu:36: Check failed: info.labels.Size() == preds.Size() (51922 vs. 103844) : Invalid shape of labels.
报错发生原因不清楚。
解决方案是:
xgboost的配置参数里,如果指定了
“objective” -> “binary:logistic”
则 “num_class” -> 2无须设置,就是把这个参数注释掉。
这样子错误就解决了。