## 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

Constructor Summary
`ForestPredictions(int nbInstances, int nblabels)`

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`

Constructor Detail

### ForestPredictions

    public ForestPredictions(int nbInstances,
                             int nblabels)

Method Detail

### 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 instance
    `instanceId` - classified instance
    `prediction` - 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.