public static class GradientTreeBoost.Trainer extends RegressionTrainer<double[]>
Constructor and Description |
---|
GradientTreeBoost.Trainer(Attribute[] attributes,
int T)
Constructor.
|
GradientTreeBoost.Trainer(int T)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
setLoss(GradientTreeBoost.Loss loss)
Sets the loss function.
|
void |
setMaximumLeafNodes(int J)
Sets the maximum number of leaf nodes in the tree.
|
void |
setNumTrees(int T)
Sets the number of trees in the random forest.
|
void |
setSamplingRates(double f)
Sets the sampling rate for stochastic tree boosting.
|
void |
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 GradientTreeBoost.Trainer(int T)
T
- the number of trees.public GradientTreeBoost.Trainer(Attribute[] attributes, int T)
attributes
- the attributes of independent variable.T
- the number of trees.public void setLoss(GradientTreeBoost.Loss loss)
loss
- the loss function.public void setNumTrees(int T)
T
- the number of trees.public void setMaximumLeafNodes(int J)
J
- the maximum number of leaf nodes in the tree.public void setShrinkage(double shrinkage)
shrinkage
- the learning rate.public void 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.Copyright © 2015. All rights reserved.