Class AUC

java.lang.Object
smile.validation.metric.AUC
All Implemented Interfaces:
Serializable, ProbabilisticClassificationMetric

public class AUC extends Object implements ProbabilisticClassificationMetric
The area under the curve (AUC). When using normalized units, the area under the curve is equal to the probability that a classifier will rank a randomly chosen positive instance higher than a randomly chosen negative one (assuming 'positive' ranks higher than 'negative').

In statistics, a receiver operating characteristic (ROC), or ROC curve, is a graphical plot that illustrates the performance of a binary classifier system as its discrimination threshold is varied. The curve is created by plotting the true positive rate (TPR) against the false positive rate (FPR) at various threshold settings.

AUC is quite noisy as a classification measure and has some other significant problems in model comparison.

We calculate AUC based on Mann-Whitney U test (https://en.wikipedia.org/wiki/Mann-Whitney_U_test).

See Also:
  • Field Summary

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

    Constructors
    Constructor
    Description
    AUC()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    of(int[] truth, double[] probability)
    Calculates AUC for binary classifier.
    double
    score(int[] truth, double[] probability)
    Returns a score to measure the quality of classification.
     

    Methods inherited from class java.lang.Object

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

    • instance

      public static final AUC instance
      Default instance.
  • Constructor Details

    • AUC

      public AUC()
  • Method Details

    • score

      public double score(int[] truth, double[] probability)
      Description copied from interface: ProbabilisticClassificationMetric
      Returns a score to measure the quality of classification.
      Specified by:
      score in interface ProbabilisticClassificationMetric
      Parameters:
      truth - the true class labels.
      probability - The posterior probability of positive class.
      Returns:
      the metric.
    • of

      public static double of(int[] truth, double[] probability)
      Calculates AUC for binary classifier.
      Parameters:
      truth - the ground truth.
      probability - the posterior probability of positive class.
      Returns:
      AUC
    • toString

      public String toString()
      Overrides:
      toString in class Object