类 TwoClassStats

java.lang.Object
weka.classifiers.evaluation.TwoClassStats
所有已实现的接口:
RevisionHandler

public class TwoClassStats extends Object implements RevisionHandler
Encapsulates performance functions for two-class problems.
版本:
$Revision: 1.9 $
作者:
Len Trigg (len@reeltwo.com)
  • 构造器概要

    构造器
    构造器
    说明
    TwoClassStats(double tp, double fp, double tn, double fn)
    Creates the TwoClassStats with the given initial performance values.
  • 方法概要

    修饰符和类型
    方法
    说明
    Generates a ConfusionMatrix representing the current two-class statistics, using class names "negative" and "positive".
    double
    Calculate the fallout.
    double
    Gets the number of positive instances predicted as negative
    double
    Gets the number of negative instances predicted as positive
    double
    Calculate the false positive rate.
    double
    Calculate the F-Measure.
    double
    Calculate the precision.
    double
    Calculate the recall.
    Returns the revision string.
    double
    Gets the number of negative instances predicted as negative
    double
    Gets the number of positive instances predicted as positive
    double
    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
    Returns a string containing the various performance measures for the current object

    从类继承的方法 java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 构造器详细资料

    • TwoClassStats

      public TwoClassStats(double tp, double fp, double tn, double fn)
      Creates the TwoClassStats with the given initial performance values.
      参数:
      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
  • 方法详细资料

    • setTruePositive

      public void setTruePositive(double tp)
      Sets the number of positive instances predicted as positive
    • setFalsePositive

      public void setFalsePositive(double fp)
      Sets the number of negative instances predicted as positive
    • setTrueNegative

      public void setTrueNegative(double tn)
      Sets the number of negative instances predicted as negative
    • setFalseNegative

      public void setFalseNegative(double fn)
      Sets the number of positive instances predicted as negative
    • getTruePositive

      public double getTruePositive()
      Gets the number of positive instances predicted as positive
    • getFalsePositive

      public double getFalsePositive()
      Gets the number of negative instances predicted as positive
    • getTrueNegative

      public double getTrueNegative()
      Gets the number of negative instances predicted as negative
    • getFalseNegative

      public double getFalseNegative()
      Gets the number of positive instances predicted as negative
    • getTruePositiveRate

      public double getTruePositiveRate()
      Calculate the true positive rate. This is defined as

       correctly classified positives
       ------------------------------
             total positives
       
      返回:
      the true positive rate
    • getFalsePositiveRate

      public double getFalsePositiveRate()
      Calculate the false positive rate. This is defined as

       incorrectly classified negatives
       --------------------------------
              total negatives
       
      返回:
      the false positive rate
    • getPrecision

      public double getPrecision()
      Calculate the precision. This is defined as

       correctly classified positives
       ------------------------------
        total predicted as positive
       
      返回:
      the precision
    • getRecall

      public double getRecall()
      Calculate the recall. This is defined as

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

      (Which is also the same as the truePositiveRate.)

      返回:
      the recall
    • getFMeasure

      public double getFMeasure()
      Calculate the F-Measure. This is defined as

       2 * recall * precision
       ----------------------
         recall + precision
       
      返回:
      the F-Measure
    • getFallout

      public double getFallout()
      Calculate the fallout. This is defined as

       incorrectly classified negatives
       --------------------------------
         total predicted as positive
       
      返回:
      the fallout
    • getConfusionMatrix

      public ConfusionMatrix getConfusionMatrix()
      Generates a ConfusionMatrix representing the current two-class statistics, using class names "negative" and "positive".
      返回:
      a ConfusionMatrix.
    • toString

      public String toString()
      Returns a string containing the various performance measures for the current object
      覆盖:
      toString 在类中 Object
    • getRevision

      public String getRevision()
      Returns the revision string.
      指定者:
      getRevision 在接口中 RevisionHandler
      返回:
      the revision