|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.evaluation.TwoClassStats
Encapsulates performance functions for two-class problems.
Field Summary | |
private static java.lang.String[] |
CATEGORY_NAMES
The names used when converting this object to a confusion matrix |
private double |
m_FalseNeg
Pos predicted as neg |
private double |
m_FalsePos
Neg predicted as pos |
private double |
m_TrueNeg
Neg predicted as neg |
private double |
m_TruePos
Pos predicted as pos |
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 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final java.lang.String[] CATEGORY_NAMES
private double m_TruePos
private double m_FalsePos
private double m_TrueNeg
private double m_FalseNeg
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()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |