Class ROCAndPRCurve

java.lang.Object
si.ijs.kt.clus.error.ROCAndPRCurve
All Implemented Interfaces:
Serializable

public class ROCAndPRCurve extends Object implements Serializable
See Also:
  • Field Details

    • serialVersionUID

      public static final long serialVersionUID
      See Also:
    • m_AreaROC

      protected double m_AreaROC
    • m_AreaPR

      protected double m_AreaPR
    • m_Thresholds

      protected double[] m_Thresholds
    • m_ExtendPR

      protected transient boolean m_ExtendPR
    • m_PrevTP

      protected transient int m_PrevTP
    • m_PrevFP

      protected transient int m_PrevFP
    • m_ROC

      protected transient ArrayList<double[]> m_ROC
    • m_PR

      protected transient ArrayList<double[]> m_PR
    • m_Values

      protected transient BinaryPredictionList m_Values
    • m_PrecisionAtRecall

      protected transient double[] m_PrecisionAtRecall
  • Constructor Details

  • Method Details

    • clear

      public void clear()
    • getROCCurve

      public ArrayList<double[]> getROCCurve()
    • getPRCurve

      public ArrayList<double[]> getPRCurve()
    • getAreaROC

      public double getAreaROC()
    • getAreaPR

      public double getAreaPR()
    • computeCurves

      public void computeCurves()
    • setThresholds

      public void setThresholds(double[] thr)
    • enumerateThresholds

      public void enumerateThresholds()
    • enumerateThresholdsAll

      public void enumerateThresholdsAll()
      Computes points for PR- and ROC- curves that would be obtained if the threshold would go continuously from Infinity to 0. Basically, this is done by sorting triples (prob, ground truth, count) (meaning that count instances from the binary class ground truth were predicted positive with probability prob) decreasingly with respect to prob (see, how m_Values are defined), and updating the current counts of true and false positives.
    • enumerateThresholdsSelected

      public void enumerateThresholdsSelected(double[] thr)
    • computeArea

      public double computeArea(ArrayList<double[]> curve)
    • addOutput

      public void addOutput(int TP, int FP)
    • addOutputROC

      public void addOutputROC(int TP, int FP)
    • addOutputPR

      public void addOutputPR(int TP, int FP)
    • addPointPR

      public void addPointPR(double prec, double recall)
    • addPointPROptimized

      public void addPointPROptimized(double prec, double recall)
    • getPrecisionAtRecall

      public double getPrecisionAtRecall(int j)
    • computePrecisions

      public void computePrecisions(double[] recallValues)
    • computePrecision

      public double computePrecision(double recall)