|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weka.classifiers.evaluation.TwoClassStats
Encapsulates performance functions for two-class problems.
Constructor Summary | |
TwoClassStats(double tp,
double fp,
double tn,
double fn)
Creates the TwoClassStats with the given initial performance values. |
Method Summary | |
ConfusionMatrix |
getConfusionMatrix()
Generates a ConfusionMatrix representing the current
two-class statistics, using class names "negative" and "positive". |
double |
getFallout()
Calculate the fallout. |
double |
getFalseNegative()
Gets the number of positive instances predicted as negative |
double |
getFalsePositive()
Gets the number of negative instances predicted as positive |
double |
getFalsePositiveRate()
Calculate the false positive rate. |
double |
getFMeasure()
Calculate the F-Measure. |
double |
getPrecision()
Calculate the precision. |
double |
getRecall()
Calculate the recall. |
double |
getTrueNegative()
Gets the number of negative instances predicted as negative |
double |
getTruePositive()
Gets the number of positive instances predicted as positive |
double |
getTruePositiveRate()
Calculate the true positive rate. |
void |
setFalseNegative(double fn)
Sets the number of positive instances predicted as negative |
void |
setFalsePositive(double fp)
Sets the number of negative instances predicted as positive |
void |
setTrueNegative(double tn)
Sets the number of negative instances predicted as negative |
void |
setTruePositive(double tp)
Sets the number of positive instances predicted as positive |
java.lang.String |
toString()
Returns a string containing the various performance measures for the current object |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public TwoClassStats(double tp, double fp, double tn, double fn)
tp
- the number of correctly classified positivesfp
- the number of incorrectly classified negativestn
- the number of correctly classified negativesfn
- the number of incorrectly classified positivesMethod Detail |
public void setTruePositive(double tp)
public void setFalsePositive(double fp)
public void setTrueNegative(double tn)
public void setFalseNegative(double fn)
public double getTruePositive()
public double getFalsePositive()
public double getTrueNegative()
public double getFalseNegative()
public double getTruePositiveRate()
correctly classified positives ------------------------------ total positives
public double getFalsePositiveRate()
incorrectly classified negatives -------------------------------- total negatives
public double getPrecision()
correctly classified positives ------------------------------ total predicted as positive
public double getRecall()
correctly classified positives ------------------------------ total positives
(Which is also the same as the truePositiveRate.)
public double getFMeasure()
2 * recall * precision ---------------------- recall + precision
public double getFallout()
incorrectly classified negatives -------------------------------- total predicted as positive
public ConfusionMatrix getConfusionMatrix()
ConfusionMatrix
representing the current
two-class statistics, using class names "negative" and "positive".
ConfusionMatrix
.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
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