Package biz.k11i.xgboost.gbm
Class GBTree
java.lang.Object
biz.k11i.xgboost.gbm.GBBase
biz.k11i.xgboost.gbm.GBTree
- All Implemented Interfaces:
GradBooster,Serializable
- Direct Known Subclasses:
Dart
Gradient boosted tree implementation.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface biz.k11i.xgboost.gbm.GradBooster
GradBooster.Factory -
Field Summary
FieldsModifier and TypeFieldDescription(package private) RegTree[][](package private) GBTree.ModelParamprivate int[]private RegTree[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidloadModel(ModelReader reader, boolean with_pbuffer) Loads model from stream.(package private) floatfloat[]Generates predictions for given feature vector.int[]predictLeaf(FVec feat, int ntree_limit) Predicts the leaf index of each tree.floatpredictSingle(FVec feat, int ntree_limit) Generates a prediction for given feature vector.(package private) int[]Methods inherited from class biz.k11i.xgboost.gbm.GBBase
setNumClass
-
Field Details
-
mparam
GBTree.ModelParam mparam -
trees
-
tree_info
private int[] tree_info -
_groupTrees
RegTree[][] _groupTrees
-
-
Constructor Details
-
GBTree
GBTree()
-
-
Method Details
-
loadModel
Description copied from interface:GradBoosterLoads model from stream.- Parameters:
reader- input streamwith_pbuffer- whether the incoming data contains pbuffer- Throws:
IOException- If an I/O error occurs
-
predict
Description copied from interface:GradBoosterGenerates predictions for given feature vector.- Parameters:
feat- feature vectorntree_limit- limit the number of trees used in prediction- Returns:
- prediction result
-
predictSingle
Description copied from interface:GradBoosterGenerates 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 prediction- Returns:
- prediction result
-
pred
-
predictLeaf
Description copied from interface:GradBoosterPredicts 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
-
predPath
-