adams.flow.transformer
Class WekaAccumulatedError.SortablePrediction

java.lang.Object
  extended by adams.flow.transformer.WekaAccumulatedError.SortablePrediction
All Implemented Interfaces:
Comparable
Enclosing class:
WekaAccumulatedError

public static class WekaAccumulatedError.SortablePrediction
extends Object
implements Comparable

Container for a classifier prediction, used for sorting.

Version:
$Revision: 4584 $
Author:
fracpete (fracpete at waikato dot ac dot nz)

Field Summary
protected  weka.classifiers.evaluation.Prediction m_Prediction
          the wrapped prediction.
 
Constructor Summary
WekaAccumulatedError.SortablePrediction(weka.classifiers.evaluation.Prediction pred)
          Initializes the container.
 
Method Summary
 int compareTo(Object o)
          Compares this object with the specified object for order.
 double getAbsoluteDifference()
          Returns the absolute difference between actual and predicted value.
 weka.classifiers.evaluation.Prediction getPrediction()
          Returns the stored prediction.
 String toString()
          Returns a string representation of the wrapped prediction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_Prediction

protected weka.classifiers.evaluation.Prediction m_Prediction
the wrapped prediction.

Constructor Detail

WekaAccumulatedError.SortablePrediction

public WekaAccumulatedError.SortablePrediction(weka.classifiers.evaluation.Prediction pred)
Initializes the container.

Parameters:
pred - the prediction to wrap
Method Detail

getPrediction

public weka.classifiers.evaluation.Prediction getPrediction()
Returns the stored prediction.

Returns:
the prediction

getAbsoluteDifference

public double getAbsoluteDifference()
Returns the absolute difference between actual and predicted value. Returns Double.MAX_VALUE if at least one of them is NaN.

Returns:
the absolute difference between actual and predicted or NaN

compareTo

public int compareTo(Object o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Uses the absolute difference between actual and predicted values.

Specified by:
compareTo in interface Comparable
Parameters:
o - the object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
ClassCastException - if the specified object's type prevents it from being compared to this object.

toString

public String toString()
Returns a string representation of the wrapped prediction.

Overrides:
toString in class Object
Returns:
the string representation


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.