Class MAD

java.lang.Object
smile.validation.metric.MAD
All Implemented Interfaces:
Serializable, RegressionMetric

public class MAD extends Object implements RegressionMetric
Mean absolute deviation error.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final MAD
    Default instance.
  • Constructor Summary

    Constructors
    Constructor
    Description
    MAD()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    of(double[] truth, double[] prediction)
    Calculates the mean absolute deviation error.
    double
    score(double[] truth, double[] prediction)
    Returns a score to measure the quality of regression.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • instance

      public static final MAD instance
      Default instance.
  • Constructor Details

    • MAD

      public MAD()
  • Method Details

    • score

      public double score(double[] truth, double[] prediction)
      Description copied from interface: RegressionMetric
      Returns a score to measure the quality of regression.
      Specified by:
      score in interface RegressionMetric
      Parameters:
      truth - the true response values.
      prediction - the predicted response values.
      Returns:
      the metric.
    • of

      public static double of(double[] truth, double[] prediction)
      Calculates the mean absolute deviation error.
      Parameters:
      truth - the ground truth.
      prediction - the prediction.
      Returns:
      the metric.
    • toString

      public String toString()
      Overrides:
      toString in class Object