public class XGBoost
extends Object
Constructor and Description |
---|
XGBoost() |
Modifier and Type | Method and Description |
---|---|
static String[] |
crossValidation(DMatrix data, Map
Cross-validation with given parameters.
|
static Booster |
loadModel(InputStream in)
Load a new Booster model from a file opened as input stream.
|
static Booster |
loadModel(String modelPath)
load model from modelPath
|
static Booster |
train(DMatrix dtrain, Map
Train a booster with given parameters.
|
public static Booster loadModel(String modelPath) throws XGBoostError
modelPath
- booster modelPath (model generated by booster.saveModel)XGBoostError
- native errorpublic static Booster loadModel(InputStream in) throws XGBoostError, IOException
in
- The input stream of the file, will be closed after this function call.XGBoostError
IOException
public static Booster train(DMatrix dtrain, Mapparams, int round, Map DMatrix> watches, IObjective obj, IEvaluation eval) throws XGBoostError
dtrain
- Data to be trained.params
- Booster params.round
- Number of boosting iterations.watches
- a group of items to be evaluated during training, this allows user to watch performance on the validation set.obj
- customized objective (set to null if not used)eval
- customized evaluation (set to null if not used)XGBoostError
- native errorpublic static String[] crossValidation(DMatrix data, Mapparams, int round, int nfold, String[] metrics, IObjective obj, IEvaluation eval) throws XGBoostError
data
- Data to be trained.params
- Booster params.round
- Number of boosting iterations.nfold
- Number of folds in CV.metrics
- Evaluation metrics to be watched in CV.obj
- customized objective (set to null if not used)eval
- customized evaluation (set to null if not used)XGBoostError
- native errorCopyright © 2016. All rights reserved.