public class ThresholdCurve extends java.lang.Object implements RevisionHandler
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FALLOUT_NAME
attribute name: Fallout
|
static java.lang.String |
FALSE_NEG_NAME
attribute name: False Negatives
|
static java.lang.String |
FALSE_POS_NAME
attribute name: False Positives
|
static java.lang.String |
FMEASURE_NAME
attribute name: FMeasure
|
static java.lang.String |
FP_RATE_NAME
attribute name: False Positive Rate"
|
static java.lang.String |
LIFT_NAME
attribute name: Lift
|
static java.lang.String |
PRECISION_NAME
attribute name: Precision
|
static java.lang.String |
RECALL_NAME
attribute name: Recall
|
static java.lang.String |
RELATION_NAME
The name of the relation used in threshold curve datasets
|
static java.lang.String |
SAMPLE_SIZE_NAME
attribute name: Sample Size
|
static java.lang.String |
THRESHOLD_NAME
attribute name: Threshold
|
static java.lang.String |
TP_RATE_NAME
attribute name: True Positive Rate
|
static java.lang.String |
TRUE_NEG_NAME
attribute name: True Negatives
|
static java.lang.String |
TRUE_POS_NAME
attribute name: True Positives
|
Constructor and Description |
---|
ThresholdCurve() |
Modifier and Type | Method and Description |
---|---|
Instances |
getCurve(java.util.ArrayList<Prediction> predictions)
Calculates the performance stats for the default class and return results
as a set of Instances.
|
Instances |
getCurve(java.util.ArrayList<Prediction> predictions,
int classIndex)
Calculates the performance stats for the desired class and return results
as a set of Instances.
|
static double |
getNPointPrecision(Instances tcurve,
int n)
Calculates the n point precision result, which is the precision averaged
over n evenly spaced (w.r.t recall) samples of the curve.
|
static double |
getPRCArea(Instances tcurve)
Calculates the area under the precision-recall curve (AUPRC).
|
java.lang.String |
getRevision()
Returns the revision string.
|
static double |
getROCArea(Instances tcurve)
Calculates the area under the ROC curve as the Wilcoxon-Mann-Whitney
statistic.
|
static int |
getThresholdInstance(Instances tcurve,
double threshold)
Gets the index of the instance with the closest threshold value to the
desired target
|
public static final java.lang.String RELATION_NAME
public static final java.lang.String TRUE_POS_NAME
public static final java.lang.String FALSE_NEG_NAME
public static final java.lang.String FALSE_POS_NAME
public static final java.lang.String TRUE_NEG_NAME
public static final java.lang.String FP_RATE_NAME
public static final java.lang.String TP_RATE_NAME
public static final java.lang.String PRECISION_NAME
public static final java.lang.String RECALL_NAME
public static final java.lang.String FALLOUT_NAME
public static final java.lang.String FMEASURE_NAME
public static final java.lang.String SAMPLE_SIZE_NAME
public static final java.lang.String LIFT_NAME
public static final java.lang.String THRESHOLD_NAME
public Instances getCurve(java.util.ArrayList<Prediction> predictions)
For the definitions of these measures, see TwoClassStats
predictions
- the predictions to base the curve onTwoClassStats
public Instances getCurve(java.util.ArrayList<Prediction> predictions, int classIndex)
predictions
- the predictions to base the curve onclassIndex
- index of the class of interest.public static double getNPointPrecision(Instances tcurve, int n)
tcurve
- a previously extracted threshold curve Instances.n
- the number of points to average over.public static double getPRCArea(Instances tcurve)
tcurve
- a previously extracted threshold curve Instances.public static double getROCArea(Instances tcurve)
tcurve
- a previously extracted threshold curve Instances.public static int getThresholdInstance(Instances tcurve, double threshold)
tcurve
- a set of instances that have been generated by this classthreshold
- the target thresholdpublic java.lang.String getRevision()
getRevision
in interface RevisionHandler