[jvm-packages] Repair spark model eval (#2841)

In the refactor to add base margins, #2532, all of the labels were lost
when creating the dmatrix. This became obvious as metrics like ndcg
always returned 1.0 regardless of the results.

Change-Id: I88be047e1c108afba4784bd3d892bfc9edeabe55
This commit is contained in:
ebernhardson
2017-11-04 15:28:47 -07:00
committed by Sergei Lebedev
parent a8f670d247
commit 78d0bd6c9d
2 changed files with 5 additions and 3 deletions

View File

@@ -116,7 +116,7 @@ abstract class XGBoostModel(protected var _booster: Booster)
null
}
}
val dMatrix = new DMatrix(labeledPointsPartition.map(_.features.asXGB), cacheFileName)
val dMatrix = new DMatrix(labeledPointsPartition.map(_.asXGB), cacheFileName)
try {
if (groupData != null) {
dMatrix.setGroup(groupData(TaskContext.getPartitionId()).toArray)