Class FDR

java.lang.Object
smile.validation.metric.FDR
All Implemented Interfaces:
Serializable, ToDoubleBiFunction<int[],int[]>, ClassificationMetric

public class FDR extends Object implements ClassificationMetric
The false discovery rate (FDR) is ratio of false positives to combined true and false positives, which is actually 1 - precision.
     FDR = FP / (TP + FP)
 
See Also:
  • Field Summary

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

    Constructors
    Constructor
    Description
    FDR()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    of(int[] truth, int[] prediction)
    Calculates the false discovery rate.
    double
    score(int[] truth, int[] prediction)
    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

    Methods inherited from interface smile.validation.metric.ClassificationMetric

    applyAsDouble
  • Field Details

    • instance

      public static final FDR instance
      Default instance.
  • Constructor Details

    • FDR

      public FDR()
  • Method Details

    • score

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

      public static double of(int[] truth, int[] prediction)
      Calculates the false discovery rate.
      Parameters:
      truth - the ground truth.
      prediction - the prediction.
      Returns:
      the metric.
    • toString

      public String toString()
      Overrides:
      toString in class Object