org.apache.mahout.df.callback
Class ForestPredictions
java.lang.Object
org.apache.mahout.df.callback.ForestPredictions
- All Implemented Interfaces:
- PredictionCallback
public class ForestPredictions
- extends Object
- implements PredictionCallback
Collects a forest's predictions
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(Object obj)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
computePredictions
public int[] computePredictions(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-2011 The Apache Software Foundation. All Rights Reserved.