public static class GradientTreeBoost.Trainer extends RegressionTrainer<double[]>
Constructor and Description |
---|
Trainer(smile.data.Attribute[] attributes,
int ntrees)
Constructor.
|
Trainer(int ntrees)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
GradientTreeBoost.Trainer |
setLoss(GradientTreeBoost.Loss loss)
Sets the loss function.
|
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 f)
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,
double[] y)
Learns a regression model with given training data.
|
setAttributes
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 setLoss(GradientTreeBoost.Loss loss)
loss
- the loss function.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 f)
f
- the sampling rate for stochastic tree boosting.public GradientTreeBoost train(double[][] x, double[] y)
RegressionTrainer
train
in class RegressionTrainer<double[]>
x
- the training instances.y
- the training response values.