public static class GradientTreeBoost.Trainer extends ClassifierTrainer<double[]>
Constructor and Description |
---|
Trainer()
Default constructor of 500 trees.
|
Trainer(smile.data.Attribute[] attributes,
int ntrees)
Constructor.
|
Trainer(int ntrees)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
GradientTreeBoost.Trainer |
setMaxNodes(int maxNodes)
Sets the maximum number of leaf nodes in the tree.
|
GradientTreeBoost.Trainer |
setNumTrees(int ntrees)
Sets the number of trees in the random forest.
|
GradientTreeBoost.Trainer |
setSamplingRates(double subsample)
Sets the sampling rate for stochastic tree boosting.
|
GradientTreeBoost.Trainer |
setShrinkage(double shrinkage)
Sets the shrinkage parameter in (0, 1] controls the learning rate of procedure.
|
GradientTreeBoost |
train(double[][] x,
int[] y)
Learns a classifier with given training data.
|
setAttributes
public Trainer()
public Trainer(int ntrees)
ntrees
- the number of trees.public Trainer(smile.data.Attribute[] attributes, int ntrees)
attributes
- the attributes of independent variable.ntrees
- the number of trees.public GradientTreeBoost.Trainer setNumTrees(int ntrees)
ntrees
- the number of trees.public GradientTreeBoost.Trainer setMaxNodes(int maxNodes)
maxNodes
- the maximum number of leaf nodes in the tree.public GradientTreeBoost.Trainer setShrinkage(double shrinkage)
shrinkage
- the learning rate.public GradientTreeBoost.Trainer setSamplingRates(double subsample)
subsample
- the sampling rate for stochastic tree boosting.public GradientTreeBoost train(double[][] x, int[] y)
ClassifierTrainer
train
in class ClassifierTrainer<double[]>
x
- the training instances.y
- the training labels.