ml.dmlc.xgboost4j.java.XGBoostError

[14:43:22] src/metric/elementwise_metric.cc:28: Check failed: (preds.size()) == (info.labels.size()) label and prediction size not match, hint: use merror or mlogloss for multi-class classification

Samebug tips0

There are no available Samebug tips for this exception. If you know how to solve this issue, help other users by writing a short tip.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web22

  • [14:43:22] src/metric/elementwise_metric.cc:28: Check failed: (preds.size()) == (info.labels.size()) label and prediction size not match, hint: use merror or mlogloss for multi-class classification
  • via GitHub by fc1plusx
    , 6 months ago
    [18:11:28] src/data/simple_csr_source.cc:44: Check failed: batch.index != nullptr
  • [21:23:06] src/learner.cc:283: Check failed: ModelInitialized() Always call InitModel or LoadModel before update
  • Stack trace

    • ml.dmlc.xgboost4j.java.XGBoostError: [14:43:22] src/metric/elementwise_metric.cc:28: Check failed: (preds.size()) == (info.labels.size()) label and prediction size not match, hint: use merror or mlogloss for multi-class classification at ml.dmlc.xgboost4j.java.JNIErrorHandle.checkCall(JNIErrorHandle.java:48) at ml.dmlc.xgboost4j.java.Booster.evalSet(Booster.java:178) at ml.dmlc.xgboost4j.scala.Booster.evalSet(Booster.scala:97) at ml.dmlc.xgboost4j.scala.spark.XGBoostModel$$anonfun$1.apply(XGBoostModel.scala:80) at ml.dmlc.xgboost4j.scala.spark.XGBoostModel$$anonfun$1.apply(XGBoostModel.scala:62) at org.apache.spark.rdd.RDD$$anonfun$mapPartitions$1$$anonfun$apply$23.apply(RDD.scala:766) at org.apache.spark.rdd.RDD$$anonfun$mapPartitions$1$$anonfun$apply$23.apply(RDD.scala:766) at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38) at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:319) at org.apache.spark.rdd.RDD.iterator(RDD.scala:283)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    You’re the first here who have seen this exception.