[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:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user