public static class RandomForest.Trainer extends ClassifierTrainer<double[]>
Constructor and Description |
---|
RandomForest.Trainer(Attribute[] attributes,
int T)
Constructor.
|
RandomForest.Trainer(int T)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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,
int[] y)
Learns a classifier 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 RandomForest train(double[][] x, int[] y)
ClassifierTrainer
train
in class ClassifierTrainer<double[]>
x
- the training instances.y
- the training labels.Copyright © 2015. All rights reserved.