public static class RandomForest.Trainer extends RegressionTrainer<double[]>
Constructor and Description |
---|
RandomForest.Trainer(Attribute[] attributes,
int T)
Constructor.
|
RandomForest.Trainer(int T)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
setMinimumNodeSize(int S)
Sets the minimum size of leaf nodes.
|
void |
setNumRandomFeatures(int M)
Sets the number of random selected features for splitting.
|
void |
setNumTrees(int T)
Sets the number of trees in the random forest.
|
RandomForest |
train(double[][] x,
double[] y)
Learns a regression model with given training data.
|
setAttributes
public RandomForest.Trainer(int T)
T
- the number of trees.public RandomForest.Trainer(Attribute[] attributes, int T)
attributes
- the attributes of independent variable.T
- the number of trees.public void setNumTrees(int T)
T
- the number of trees.public void setNumRandomFeatures(int M)
M
- the number of random selected features to be used to determine
the decision at a node of the tree. floor(sqrt(dim)) seems to give
generally good performance, where dim is the number of variables.public void setMinimumNodeSize(int S)
S
- the number of instances in a node below which the tree will
not split, setting S = 5 generally gives good results.public RandomForest 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.