public class TwoClassStats extends java.lang.Object implements RevisionHandler
Constructor and Description |
---|
TwoClassStats(double tp,
double fp,
double tn,
double fn)
Creates the TwoClassStats with the given initial performance values.
|
Modifier and Type | Method and Description |
---|---|
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.
|
java.lang.String |
getRevision()
Returns the revision string.
|
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
|
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 positivespublic 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
public java.lang.String getRevision()
getRevision
in interface RevisionHandler