0
点赞
收藏
分享

微信扫一扫

xgboost4j报错:Check failed:preds.Size()==info.labels_.Size()

weednoah 2022-04-20 阅读 29

运行过程中报出以下错误:

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无须设置,就是把这个参数注释掉。
这样子错误就解决了。

举报

相关推荐

0 条评论