Package adams.flow.transformer
Class WekaAccumulatedError.SortablePrediction
- java.lang.Object
-
- 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$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description protected weka.classifiers.evaluation.Prediction
m_Prediction
the wrapped prediction.
-
Constructor Summary
Constructors Constructor Description SortablePrediction(weka.classifiers.evaluation.Prediction pred)
Initializes the container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
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 interfaceComparable
- 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.
-
-