[jvm-packages] enable predictLeaf/predictContrib/treeLimit in 0.8 (#3532)

* add back train method but mark as deprecated

* add back train method but mark as deprecated

* fix scalastyle error

* fix scalastyle error

* partial finish

* no test

* add test cases

* add test cases

* address comments

* add test for regressor

* fix typo
This commit is contained in:
Nan Zhu
2018-08-07 14:01:18 -07:00
committed by GitHub
parent 246ec92163
commit 1c08b3b2ea
7 changed files with 349 additions and 32 deletions

View File

@@ -125,8 +125,8 @@ class Booster private[xgboost4j](private[xgboost4j] var booster: JBooster)
* @return predict result
*/
@throws(classOf[XGBoostError])
def predict(data: DMatrix, outPutMargin: Boolean = false, treeLimit: Int = 0)
: Array[Array[Float]] = {
def predict(data: DMatrix, outPutMargin: Boolean = false, treeLimit: Int = 0):
Array[Array[Float]] = {
booster.predict(data.jDMatrix, outPutMargin, treeLimit)
}
@@ -139,7 +139,7 @@ class Booster private[xgboost4j](private[xgboost4j] var booster: JBooster)
* @throws XGBoostError native error
*/
@throws(classOf[XGBoostError])
def predictLeaf(data: DMatrix, treeLimit: Int = 0) : Array[Array[Float]] = {
def predictLeaf(data: DMatrix, treeLimit: Int = 0): Array[Array[Float]] = {
booster.predictLeaf(data.jDMatrix, treeLimit)
}