public class GBTree
extends java.lang.Object
GradBooster.Factory| Modifier and Type | Field and Description |
|---|---|
protected int |
num_class |
protected int |
num_feature |
protected int |
num_output_group |
| Constructor and Description |
|---|
GBTree() |
| Modifier and Type | Method and Description |
|---|---|
RegTree[][] |
getGroupedTrees() |
void |
loadModel(PredictorConfiguration config,
ModelReader reader,
boolean with_pbuffer)
Loads model from stream.
|
float[] |
predict(FVec feat,
int ntree_limit)
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.
|
float |
predictSingle(FVec feat,
int ntree_limit)
Generates a prediction for given feature vector.
|
void |
setNumClass(int numClass) |
void |
setNumFeature(int numFeature) |
protected int num_class
protected int num_feature
protected int num_output_group
public void loadModel(PredictorConfiguration config, ModelReader reader, boolean with_pbuffer) throws java.io.IOException
GradBoosterconfig - predictor configurationreader - input streamwith_pbuffer - whether the incoming data contains pbufferjava.io.IOException - If an I/O error occurspublic float[] predict(FVec feat, int ntree_limit)
GradBoosterfeat - feature vectorntree_limit - limit the number of trees used in predictionpublic float predictSingle(FVec feat, int ntree_limit)
GradBoosterThis method only works when the model outputs single value.
feat - feature vectorntree_limit - limit the number of trees used in predictionpublic int[] predictLeaf(FVec feat, int ntree_limit)
GradBoosterfeat - feature vectorntree_limit - limit the number of trees used in predictionpublic java.lang.String[] predictLeafPath(FVec feat, int ntree_limit)
GradBoosterfeat - feature vectorntree_limit - limit the number of trees used in predictionpublic RegTree[][] getGroupedTrees()
public void setNumClass(int numClass)
setNumClass in interface GradBoosterpublic void setNumFeature(int numFeature)
setNumFeature in interface GradBooster