org.apache.mahout.df.callback
Class ForestPredictions
java.lang.Object
org.apache.mahout.df.callback.ForestPredictions
- All Implemented Interfaces:
- PredictionCallback
public class ForestPredictions
- extends java.lang.Object
- implements PredictionCallback
Collects a forest's predictions
Method Summary |
int[] |
computePredictions(java.util.Random rng)
compute the prediction for each instance. |
boolean |
equals(java.lang.Object obj)
|
int |
hashCode()
|
void |
prediction(int treeId,
int instanceId,
int prediction)
called when an instance has been classified |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
ForestPredictions
public ForestPredictions(int nbInstances,
int nblabels)
prediction
public void prediction(int treeId,
int instanceId,
int prediction)
- Description copied from interface:
PredictionCallback
- called when an instance has been classified
- Specified by:
prediction
in interface PredictionCallback
- Parameters:
treeId
- tree that classified the instanceinstanceId
- classified instanceprediction
- predicted label
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
computePredictions
public int[] computePredictions(java.util.Random rng)
- compute the prediction for each instance. the prediction of an instance is the index of the label that
got most of the votes
Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.