public final class RandomForest extends AbstractClassifier
| Modifier and Type | Method and Description |
|---|---|
RandomForest |
compile() |
static RandomForest |
create(int numTrees)
Creates a new random forest, trains on one thread with the number of trees
supplied.
|
static RandomForest |
create(int numTrees,
FeatureType[] types)
Creates a new random forest, trains on one thread with the number of trees
supplied.
|
static RandomForest |
deserialize(DataInput in)
Reads a new forest from the given stream.
|
RandomForest |
numThreads(int numThreads) |
de.jungblut.math.DoubleVector |
predict(de.jungblut.math.DoubleVector features)
Classifies the given features.
|
de.jungblut.math.DoubleVector |
predictProbability(de.jungblut.math.DoubleVector features)
Classifies the given features.
|
static void |
serialize(RandomForest tree,
DataOutput out)
Writes the given forest to the output stream.
|
RandomForest |
setFeatureTypes(FeatureType[] types) |
RandomForest |
setMaxHeight(int max)
Sets the maximum height of this random forest.
|
RandomForest |
setNumRandomFeaturesToChoose(int numRandomFeaturesToChoose) |
void |
train(de.jungblut.math.DoubleVector[] features,
de.jungblut.math.DoubleVector[] outcome)
Trains this classifier with the given features and the outcome.
|
RandomForest |
verbose() |
RandomForest |
verbose(boolean verb) |
trainextractPredictedClass, extractPredictedClass, predictedClass, predictedClassclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasClassifier, extractPredictedClass, extractPredictedClass, predictedClass, predictedClasspublic void train(de.jungblut.math.DoubleVector[] features,
de.jungblut.math.DoubleVector[] outcome)
Classifiertrain in interface Classifiertrain in class AbstractClassifieroutcome - the outcome must have classes labeled as doubles. E.G. in
the binary case you have a single element and decide between 0d
and 1d. In higher dimensional cases you have each of these single
elements mapped to a dimension.public de.jungblut.math.DoubleVector predict(de.jungblut.math.DoubleVector features)
Predictorpublic de.jungblut.math.DoubleVector predictProbability(de.jungblut.math.DoubleVector features)
PredictorpredictProbability in interface PredictorpredictProbability in class AbstractPredictorpublic RandomForest compile()
public RandomForest verbose()
public RandomForest verbose(boolean verb)
public RandomForest setMaxHeight(int max)
public RandomForest numThreads(int numThreads)
public RandomForest setNumRandomFeaturesToChoose(int numRandomFeaturesToChoose)
public RandomForest setFeatureTypes(FeatureType[] types)
public static RandomForest create(int numTrees)
public static RandomForest create(int numTrees, FeatureType[] types)
public static void serialize(RandomForest tree, DataOutput out) throws IOException
IOExceptionpublic static RandomForest deserialize(DataInput in) throws IOException
IOExceptionCopyright © 2016. All rights reserved.