Package si.ijs.kt.clus.error
Class ROCAndPRCurve
java.lang.Object
si.ijs.kt.clus.error.ROCAndPRCurve
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected doubleprotected doubleprotected booleanprotected ArrayList<double[]>protected double[]protected intprotected intprotected ArrayList<double[]>protected double[]protected BinaryPredictionListstatic final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOutput(int TP, int FP) voidaddOutputPR(int TP, int FP) voidaddOutputROC(int TP, int FP) voidaddPointPR(double prec, double recall) voidaddPointPROptimized(double prec, double recall) voidclear()doublecomputeArea(ArrayList<double[]> curve) voiddoublecomputePrecision(double recall) voidcomputePrecisions(double[] recallValues) voidvoidComputes points for PR- and ROC- curves that would be obtained if the threshold would go continuously from Infinity to 0.voidenumerateThresholdsSelected(double[] thr) doubledoubleArrayList<double[]>doublegetPrecisionAtRecall(int j) ArrayList<double[]>voidsetThresholds(double[] thr)
-
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
-
m_PR
-
m_Values
-
m_PrecisionAtRecall
protected transient double[] m_PrecisionAtRecall
-
-
Constructor Details
-
ROCAndPRCurve
-
-
Method Details
-
clear
public void clear() -
getROCCurve
-
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 thatcountinstances from the binary classground truthwere predicted positive with probabilityprob) decreasingly with respect toprob(see, howm_Valuesare defined), and updating the current counts of true and false positives. -
enumerateThresholdsSelected
public void enumerateThresholdsSelected(double[] thr) -
computeArea
-
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)
-