[jvm-packages] throw exception when tree_method=approx and device=cuda (#9478)
--------- Co-authored-by: Jiaming Yuan <jm.yuan@outlook.com>
This commit is contained in:
@@ -92,4 +92,15 @@ class ParameterSuite extends AnyFunSuite with PerTest with BeforeAndAfterAll {
|
||||
classifier.getBaseScore
|
||||
}
|
||||
}
|
||||
|
||||
test("approx can't be used for gpu train") {
|
||||
val paramMap = Map("tree_method" -> "approx", "device" -> "cuda")
|
||||
val trainingDF = buildDataFrame(MultiClassification.train)
|
||||
val xgb = new XGBoostClassifier(paramMap)
|
||||
val thrown = intercept[IllegalArgumentException] {
|
||||
xgb.fit(trainingDF)
|
||||
}
|
||||
assert(thrown.getMessage.contains("The tree method \"approx\" is not yet supported " +
|
||||
"for Spark GPU cluster"))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user