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 double
protected double
protected boolean
protected ArrayList<double[]>
protected double[]
protected int
protected int
protected ArrayList<double[]>
protected double[]
protected BinaryPredictionList
static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addOutput
(int TP, int FP) void
addOutputPR
(int TP, int FP) void
addOutputROC
(int TP, int FP) void
addPointPR
(double prec, double recall) void
addPointPROptimized
(double prec, double recall) void
clear()
double
computeArea
(ArrayList<double[]> curve) void
double
computePrecision
(double recall) void
computePrecisions
(double[] recallValues) void
void
Computes points for PR- and ROC- curves that would be obtained if the threshold would go continuously from Infinity to 0.void
enumerateThresholdsSelected
(double[] thr) double
double
ArrayList<double[]>
double
getPrecisionAtRecall
(int j) ArrayList<double[]>
void
setThresholds
(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 thatcount
instances from the binary classground truth
were predicted positive with probabilityprob
) decreasingly with respect toprob
(see, howm_Values
are 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)
-