Package biz.k11i.xgboost.gbm
Interface GradBooster
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classGradBooster.Factory
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidloadModel(PredictorConfiguration config, ModelReader reader, boolean with_pbuffer)Loads model from stream.float[]predict(FVec feat, int ntree_limit, float base_score)Generates predictions for given feature vector.int[]predictLeaf(FVec feat, int ntree_limit)Predicts the leaf index of each tree.java.lang.String[]predictLeafPath(FVec feat, int ntree_limit)Predicts the path to leaf of each tree.floatpredictSingle(FVec feat, int ntree_limit, float base_score)Generates a prediction for given feature vector.voidsetNumClass(int numClass)voidsetNumFeature(int numFeature)
-
-
-
Method Detail
-
setNumClass
void setNumClass(int numClass)
-
setNumFeature
void setNumFeature(int numFeature)
-
loadModel
void loadModel(PredictorConfiguration config, ModelReader reader, boolean with_pbuffer) throws java.io.IOException
Loads model from stream.- Parameters:
config- predictor configurationreader- input streamwith_pbuffer- whether the incoming data contains pbuffer- Throws:
java.io.IOException- If an I/O error occurs
-
predict
float[] predict(FVec feat, int ntree_limit, float base_score)
Generates predictions for given feature vector.- Parameters:
feat- feature vectorntree_limit- limit the number of trees used in predictionbase_score- base score to initialize prediction- Returns:
- prediction result
-
predictSingle
float predictSingle(FVec feat, int ntree_limit, float base_score)
Generates a prediction for given feature vector.This method only works when the model outputs single value.
- Parameters:
feat- feature vectorntree_limit- limit the number of trees used in predictionbase_score- base score to initialize prediction- Returns:
- prediction result
-
predictLeaf
int[] predictLeaf(FVec feat, int ntree_limit)
Predicts the leaf index of each tree. This is only valid in gbtree predictor.- Parameters:
feat- feature vectorntree_limit- limit the number of trees used in prediction- Returns:
- predicted leaf indexes
-
predictLeafPath
java.lang.String[] predictLeafPath(FVec feat, int ntree_limit)
Predicts the path to leaf of each tree. This is only valid in gbtree predictor.- Parameters:
feat- feature vectorntree_limit- limit the number of trees used in prediction- Returns:
- predicted path to leaves
-
-