Class 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 Detail

      • m_Prediction

        protected weka.classifiers.evaluation.Prediction m_Prediction
        the wrapped prediction.
    • Constructor Detail

      • SortablePrediction

        public 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