All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.classifiers.evaluation.TwoClassStats

java.lang.Object
    |
    +----weka.classifiers.evaluation.TwoClassStats

public class TwoClassStats
extends java.lang.Object
Encapsulates performance functions for two-class problems.

Version:
$Revision: 1.5 $
Author:
Len Trigg (len@intelligenesis.net)

Constructor Index

 o TwoClassStats(double, double, double, double)
Creates the TwoClassStats with the given initial performance values.

Method Index

 o getConfusionMatrix()
Generates a ConfusionMatrix representing the current two-class statistics, using class names "negative" and "positive".
 o getFallout()
Calculate the fallout.
 o getFalseNegative()
Gets the number of positive instances predicted as negative
 o getFalsePositive()
Gets the number of negative instances predicted as positive
 o getFalsePositiveRate()
Calculate the false positive rate.
 o getFMeasure()
Calculate the F-Measure.
 o getPrecision()
Calculate the precision.
 o getRecall()
Calculate the recall.
 o getTrueNegative()
Gets the number of negative instances predicted as negative
 o getTruePositive()
Gets the number of positive instances predicted as positive
 o getTruePositiveRate()
Calculate the true positive rate.
 o setFalseNegative(double)
Sets the number of positive instances predicted as negative
 o setFalsePositive(double)
Sets the number of negative instances predicted as positive
 o setTrueNegative(double)
Sets the number of negative instances predicted as negative
 o setTruePositive(double)
Sets the number of positive instances predicted as positive
 o toString()
Returns a string containing the various performance measures for the current object

Constructor Detail

 o TwoClassStats
public TwoClassStats(double tp,
                     double fp,
                     double tn,
                     double fn)
          Creates the TwoClassStats with the given initial performance values.
Parameters:
tp - the number of correctly classified positives
fp - the number of incorrectly classified negatives
tn - the number of correctly classified negatives
fn - the number of incorrectly classified positives

Method Detail

 o setTruePositive
public void setTruePositive(double tp)
          Sets the number of positive instances predicted as positive
 o setFalsePositive
public void setFalsePositive(double fp)
          Sets the number of negative instances predicted as positive
 o setTrueNegative
public void setTrueNegative(double tn)
          Sets the number of negative instances predicted as negative
 o setFalseNegative
public void setFalseNegative(double fn)
          Sets the number of positive instances predicted as negative
 o getTruePositive
public double getTruePositive()
          Gets the number of positive instances predicted as positive
 o getFalsePositive
public double getFalsePositive()
          Gets the number of negative instances predicted as positive
 o getTrueNegative
public double getTrueNegative()
          Gets the number of negative instances predicted as negative
 o getFalseNegative
public double getFalseNegative()
          Gets the number of positive instances predicted as negative
 o getTruePositiveRate
public double getTruePositiveRate()
          Calculate the true positive rate. This is defined as

 correctly classified positives
 ------------------------------
       total positives
 
Returns:
the true positive rate
 o getFalsePositiveRate
public double getFalsePositiveRate()
          Calculate the false positive rate. This is defined as

 incorrectly classified negatives
 --------------------------------
        total negatives
 
Returns:
the false positive rate
 o getPrecision
public double getPrecision()
          Calculate the precision. This is defined as

 correctly classified positives
 ------------------------------
  total predicted as positive
 
Returns:
the precision
 o getRecall
public double getRecall()
          Calculate the recall. This is defined as

 correctly classified positives
 ------------------------------
       total positives
 

(Which is also the same as the truePositiveRate.)

Returns:
the recall
 o getFMeasure
public double getFMeasure()
          Calculate the F-Measure. This is defined as

 2 * recall * precision
 ----------------------
   recall + precision
 
Returns:
the F-Measure
 o getFallout
public double getFallout()
          Calculate the fallout. This is defined as

 incorrectly classified negatives
 --------------------------------
   total predicted as positive
 
Returns:
the fallout
 o getConfusionMatrix
public ConfusionMatrix getConfusionMatrix()
          Generates a ConfusionMatrix representing the current two-class statistics, using class names "negative" and "positive".
Returns:
a ConfusionMatrix.
 o toString
public java.lang.String toString()
          Returns a string containing the various performance measures for the current object
Overrides:
toString in class java.lang.Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home