Package cc.mallet.classify.evaluate
Class AccuracyCoverage
- java.lang.Object
-
- 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
Nested Classes Modifier and Type Class Description class
AccuracyCoverage.ClassificationComparator
-
Constructor Summary
Constructors Constructor Description 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 arrayAccuracyCoverage(Trial t, java.lang.String title)
AccuracyCoverage(Trial t, java.lang.String title, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
accuracyAtCoverage(double cov)
accuracy at a given coverage percentagedouble[]
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 trapezoidvoid
displayGraph()
Displays the accuracy v.void
sortClassifications()
Sort classifications ArrayList by winner's value
-
-
-
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 fromnumBuckets
- 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 interfacejava.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()
-
-