public class GBLinear
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 |
|---|
GBLinear() |
| Modifier and Type | Method and Description |
|---|---|
float |
bias(int gid) |
int |
getNumFeature() |
int |
getNumOutputGroup() |
void |
loadModel(PredictorConfiguration config,
ModelReader reader,
boolean ignored_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) |
float |
weight(int fid,
int gid) |
protected int num_class
protected int num_feature
protected int num_output_group
public void loadModel(PredictorConfiguration config, ModelReader reader, boolean ignored_with_pbuffer) throws java.io.IOException
GradBoosterconfig - predictor configurationreader - input streamignored_with_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 float weight(int fid,
int gid)
public float bias(int gid)
public int getNumFeature()
public int getNumOutputGroup()
public void setNumClass(int numClass)
setNumClass in interface GradBoosterpublic void setNumFeature(int numFeature)
setNumFeature in interface GradBooster