[jvm-packages] Expose nativeBooster for XGBoostClassificationModel and XGBoostRegressionModel. (#3428)

This commit is contained in:
Yanbo Liang 2018-07-01 15:06:16 -07:00 committed by Nan Zhu
parent 295252249e
commit aec6299c49
2 changed files with 12 additions and 0 deletions

View File

@ -211,6 +211,12 @@ class XGBoostClassificationModel private[ml](
// only called in copy()
def this(uid: String) = this(uid, 2, null)
/**
* Get the native booster instance of this model.
* This is used to call low-level APIs on native booster, such as "getFeatureScore".
*/
def nativeBooster: Booster = _booster
private var trainingSummary: Option[XGBoostTrainingSummary] = None
/**

View File

@ -207,6 +207,12 @@ class XGBoostRegressionModel private[ml] (
// only called in copy()
def this(uid: String) = this(uid, null)
/**
* Get the native booster instance of this model.
* This is used to call low-level APIs on native booster, such as "getFeatureScore".
*/
def nativeBooster: Booster = _booster
private var trainingSummary: Option[XGBoostTrainingSummary] = None
/**