|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weka.classifiers.evaluation.ThresholdCurve
Generates points illustrating prediction tradeoffs that can be obtained by varying the threshold value between classes. For example, the typical threshold value of 0.5 means the predicted probability of "positive" must be higher than 0.5 for the instance to be predicted as "positive". The resulting dataset can be used to visualize precision/recall tradeoff, or for ROC curve analysis (true positive rate vs false positive rate).
Field Summary | |
static java.lang.String |
FALLOUT_NAME
|
static java.lang.String |
FALSE_NEG_NAME
|
static java.lang.String |
FALSE_POS_NAME
|
static java.lang.String |
FMEASURE_NAME
|
static java.lang.String |
FP_RATE_NAME
|
static java.lang.String |
PRECISION_NAME
|
static java.lang.String |
RECALL_NAME
|
static java.lang.String |
RELATION_NAME
The name of the relation used in threshold curve datasets |
static java.lang.String |
THRESHOLD_NAME
|
static java.lang.String |
TP_RATE_NAME
|
static java.lang.String |
TRUE_NEG_NAME
|
static java.lang.String |
TRUE_POS_NAME
|
Constructor Summary | |
ThresholdCurve()
|
Method Summary | |
Instances |
getCurve(FastVector predictions)
Calculates the performance stats for the default class and return results as a set of Instances. |
Instances |
getCurve(FastVector 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 |
getROCArea(Instances tcurve)
Calculates the area under the ROC curve. |
static int |
getThresholdInstance(Instances tcurve,
double threshold)
Gets the index of the instance with the closest threshold value to the desired target |
static void |
main(java.lang.String[] args)
Tests the ThresholdCurve generation from the command line. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
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 THRESHOLD_NAME
Constructor Detail |
public ThresholdCurve()
Method Detail |
public Instances getCurve(FastVector predictions)
For the definitions of these measures, see TwoClassStats
TwoClassStats
public Instances getCurve(FastVector predictions, int classIndex)
classIndex
- 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 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 threshold
public static void main(java.lang.String[] args)
args
- currently ignored
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2003 David Lindsay, Computer Learning Research Centre, Dept. Computer Science, Royal Holloway, University of London