Package com.tagtraum.core.ml
Class RandomForestClassifier
- java.lang.Object
-
- com.tagtraum.core.ml.RandomForest
-
- com.tagtraum.core.ml.RandomForestClassifier
-
public class RandomForestClassifier extends RandomForest
RandomForestClassifier.- Author:
- Hendrik Schreiber
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.tagtraum.core.ml.RandomForest
RandomForest.Node
-
-
Field Summary
-
Fields inherited from class com.tagtraum.core.ml.RandomForest
trees
-
-
Constructor Summary
Constructors Constructor Description RandomForestClassifier(URL model)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
predict(float[] features)
float
predict(SortedMap<Float,Float> votes)
Predict based on a vote distribution.SortedMap<Float,Float>
voteDistribution(float[] features)
Returns the forest's vote distribution.List<Float>
votes(float[] features)
Returns the forest's votes.-
Methods inherited from class com.tagtraum.core.ml.RandomForest
toBinary, toDebugString, toString
-
-
-
-
Constructor Detail
-
RandomForestClassifier
public RandomForestClassifier(URL model) throws IOException
- Throws:
IOException
-
-
Method Detail
-
predict
public float predict(float[] features)
- Specified by:
predict
in classRandomForest
-
predict
public float predict(SortedMap<Float,Float> votes)
Predict based on a vote distribution.- Parameters:
votes
- vote distribution- Returns:
- prediction
-
voteDistribution
public SortedMap<Float,Float> voteDistribution(float[] features)
Returns the forest's vote distribution.- Parameters:
features
- features- Returns:
- relative vote distribution
-
-