cc.mallet.classify.evaluate
Class AccuracyCoverage

java.lang.Object
  extended by cc.mallet.classify.evaluate.AccuracyCoverage
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class AccuracyCoverage
extends java.lang.Object
implements java.awt.event.ActionListener

Methods for calculating and displaying the accuracy v. coverage data for a Trial


Nested Class Summary
 class AccuracyCoverage.ClassificationComparator
           
 
Constructor Summary
AccuracyCoverage(Classifier C, InstanceList ilist, int numBuckets, java.lang.String title)
           
AccuracyCoverage(Classifier C, InstanceList ilist, java.lang.String title)
           
AccuracyCoverage(Trial t, int numBuckets, java.lang.String title, java.lang.String dataName)
          Constructs object, sorts classifications, and creates accuracyValues array
AccuracyCoverage(Trial t, java.lang.String title)
           
AccuracyCoverage(Trial t, java.lang.String title, java.lang.String name)
           
 
Method Summary
 double accuracyAtCoverage(double cov)
          accuracy at a given coverage percentage
 double[] accuracyValues()
           
 void actionPerformed(java.awt.event.ActionEvent event)
           
 void addDataToGraph(double[] accValues, int nBuckets, java.lang.String name)
           
 void addTrial(Trial t, int nBuckets, java.lang.String name)
           
 void addTrial(Trial t, java.lang.String name)
           
 void createAccuracyArray()
          Creates array of accuracy values for coverage at each step as defined by numBuckets.
 double cumulativeAccuracy()
          Finds the "area under the acc/cov curve" steps by one percentage point and calcs area of trapezoid
 void displayGraph()
          Displays the accuracy v.
 void sortClassifications()
          Sort classifications ArrayList by winner's value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccuracyCoverage

public AccuracyCoverage(Trial t,
                        int numBuckets,
                        java.lang.String title,
                        java.lang.String dataName)
Constructs object, sorts classifications, and creates accuracyValues array

Parameters:
t - trial to get data from
numBuckets - number of x-axis measurements to find accuracy

AccuracyCoverage

public AccuracyCoverage(Trial t,
                        java.lang.String title,
                        java.lang.String name)

AccuracyCoverage

public AccuracyCoverage(Trial t,
                        java.lang.String title)

AccuracyCoverage

public AccuracyCoverage(Classifier C,
                        InstanceList ilist,
                        java.lang.String title)

AccuracyCoverage

public AccuracyCoverage(Classifier C,
                        InstanceList ilist,
                        int numBuckets,
                        java.lang.String title)
Method Detail

cumulativeAccuracy

public double cumulativeAccuracy()
Finds the "area under the acc/cov curve" steps by one percentage point and calcs area of trapezoid


createAccuracyArray

public void createAccuracyArray()
Creates array of accuracy values for coverage at each step as defined by numBuckets.


accuracyAtCoverage

public double accuracyAtCoverage(double cov)
accuracy at a given coverage percentage

Parameters:
cov - coverage percentage
Returns:
accuracy value

sortClassifications

public void sortClassifications()
Sort classifications ArrayList by winner's value


addDataToGraph

public void addDataToGraph(double[] accValues,
                           int nBuckets,
                           java.lang.String name)

displayGraph

public void displayGraph()
Displays the accuracy v. coverage graph


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

addTrial

public void addTrial(Trial t,
                     java.lang.String name)

addTrial

public void addTrial(Trial t,
                     int nBuckets,
                     java.lang.String name)

accuracyValues

public double[] accuracyValues()