[jvm-packages] fix "key not found: train" issue (#6842)
* [jvm-packages] fix "key not found: train" issue * fix bug
This commit is contained in:
@@ -377,7 +377,7 @@ object XGBoost extends Serializable {
|
||||
// to workaround the empty partitions in training dataset,
|
||||
// this might not be the best efficient implementation, see
|
||||
// (https://github.com/dmlc/xgboost/issues/1277)
|
||||
if (watches.toMap("train").rowNum == 0) {
|
||||
if (!watches.toMap.contains("train")) {
|
||||
throw new XGBoostError(
|
||||
s"detected an empty partition in the training data, partition ID:" +
|
||||
s" ${TaskContext.getPartitionId()}")
|
||||
|
||||
Reference in New Issue
Block a user