|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.udo.cs.yale.operator.AbstractIOObject
edu.udo.cs.yale.operator.ResultObjectAdapter
edu.udo.cs.yale.tools.math.Averagable
edu.udo.cs.yale.operator.performance.PerformanceCriterion
edu.udo.cs.yale.operator.performance.MeasuredPerformance
edu.udo.cs.yale.operator.performance.BinaryClassificationPerformance
public class BinaryClassificationPerformance
This class encapsulates the well known binary classification criteria precision and recall. Furthermore it can be used to calculate the fallout, the equally weighted f-measure (f1-measure), the lift, and the values for TRUE_POSITIVE, FALSE_POSITIVE, TRUE_NEGATIVE, and FALSE_NEGATIVE. With "positive" we refer to the first class and with "negative" we refer to the second.
| Field Summary | |
|---|---|
private int[][] |
counter
true label, predicted label. |
static java.lang.String[] |
DESCRIPTION
|
static int |
F_MEASURE
|
static int |
FALLOUT
|
static int |
FALSE_NEGATIVE
|
static int |
FALSE_POSITIVE
|
static int |
LIFT
|
static java.lang.String[] |
NAME
|
private int |
negative
|
private static int |
NEGATIVE
|
private java.lang.String |
negativeClassName
Name of the negative class. |
private static int |
POSITIVE
|
private java.lang.String |
positiveClassName
Name of the positive class. |
static int |
PRECISION
|
static int |
RECALL
|
static int |
TRUE_NEGATIVE
|
static int |
TRUE_POSITIVE
|
private int |
type
|
| Constructor Summary | |
|---|---|
BinaryClassificationPerformance()
|
|
BinaryClassificationPerformance(int type)
|
|
BinaryClassificationPerformance(int type,
int negative)
|
|
BinaryClassificationPerformance(int type,
int[][] counter)
For test cases only. |
|
| Method Summary | |
|---|---|
void |
buildSingleAverage(Averagable performance)
This method should build the average of this and another averagables of the same type. |
protected void |
cloneAveragable(Averagable newPC)
Must be implemented by subclasses such that it copies all values of other to this. |
void |
countExample(Example example)
Counts a single example, e.g. by summing up errors. |
boolean |
formatPercent()
Indicates wether or not percentage format should be used in the Averagable.toString() method. |
java.lang.String |
getDescription()
Returns a description of the performance criterion. |
int |
getExampleCount()
Returns the number of data points which was used to determine the criterion value. |
double |
getFitness()
Returns the fitness depending on the value. |
double |
getMaxFitness()
Returns the maximum fitness. |
double |
getMikroAverage()
Returns the (current) value of the averagable (the average itself). |
double |
getMikroVariance()
Returns the variance of the averagable. |
java.lang.String |
getName()
Returns the name of this averagable. |
static BinaryClassificationPerformance |
newInstance(java.lang.String name)
|
void |
readCriterionData(java.io.BufferedReader in)
Reads the performance data from the given reader. |
void |
startCounting(ExampleSet eSet)
Initialises the criterion. |
java.lang.String |
toHTML()
Returns a HTML table for the confusion matrix. |
java.lang.String |
toString()
|
void |
writeCriterionData(java.io.PrintWriter out)
Writes the performance criterion into the given writer. |
| Methods inherited from class edu.udo.cs.yale.operator.performance.PerformanceCriterion |
|---|
compareTo, readPerformanceCriterion, writePerformanceCriterion |
| Methods inherited from class edu.udo.cs.yale.tools.math.Averagable |
|---|
buildAverage, clone, formatDeviation, formatValue, getAverage, getMakroAverage, getMakroStandardDeviation, getMakroVariance, getMikroStandardDeviation, getStandardDeviation, getVariance |
| Methods inherited from class edu.udo.cs.yale.operator.ResultObjectAdapter |
|---|
addAction, getActions, getVisualisationComponent, toHTML, toResultString |
| Methods inherited from class edu.udo.cs.yale.operator.AbstractIOObject |
|---|
copy, read, read, read, write, write |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface edu.udo.cs.yale.operator.IOObject |
|---|
copy, write, write |
| Field Detail |
|---|
public static final int PRECISION
public static final int RECALL
public static final int LIFT
public static final int FALLOUT
public static final int F_MEASURE
public static final int FALSE_POSITIVE
public static final int FALSE_NEGATIVE
public static final int TRUE_POSITIVE
public static final int TRUE_NEGATIVE
private static final int NEGATIVE
private static final int POSITIVE
public static final java.lang.String[] NAME
public static final java.lang.String[] DESCRIPTION
private int type
private int negative
private int[][] counter
private java.lang.String positiveClassName
private java.lang.String negativeClassName
| Constructor Detail |
|---|
public BinaryClassificationPerformance()
public BinaryClassificationPerformance(int type)
public BinaryClassificationPerformance(int type,
int negative)
public BinaryClassificationPerformance(int type,
int[][] counter)
| Method Detail |
|---|
public static BinaryClassificationPerformance newInstance(java.lang.String name)
public void writeCriterionData(java.io.PrintWriter out)
throws java.io.IOException
PerformanceCriterion
writeCriterionData in class PerformanceCriterionjava.io.IOException
public void readCriterionData(java.io.BufferedReader in)
throws java.io.IOException
PerformanceCriterion
readCriterionData in class PerformanceCriterionjava.io.IOExceptionpublic int getExampleCount()
PerformanceCriterion
getExampleCount in class PerformanceCriterion
public void startCounting(ExampleSet eSet)
throws OperatorException
MeasuredPerformance
startCounting in class MeasuredPerformanceOperatorExceptionpublic void countExample(Example example)
MeasuredPerformance
countExample in class MeasuredPerformancepublic double getMikroAverage()
Averagable
getMikroAverage in class Averagablepublic double getFitness()
PerformanceCriterion
getFitness in class PerformanceCriterionpublic double getMaxFitness()
PerformanceCriterion
getMaxFitness in class PerformanceCriterionpublic double getMikroVariance()
Averagable
getMikroVariance in class Averagablepublic java.lang.String getName()
Averagable
getName in interface ResultObjectgetName in class Averagablepublic java.lang.String getDescription()
MeasuredPerformance
getDescription in class MeasuredPerformancepublic boolean formatPercent()
AveragableAveragable.toString() method. The default implementation returns false.
formatPercent in class Averagableprotected void cloneAveragable(Averagable newPC)
Averagableother to this. When this method is called,
it is guaranteed, that other is a subclass of the class of
the object it is called on.
cloneAveragable in class Averagablepublic void buildSingleAverage(Averagable performance)
AveragableSimpleCriterion for a simple
implementation example.
buildSingleAverage in class Averagablepublic java.lang.String toString()
toString in class Averagablepublic java.lang.String toHTML()
toHTML in class Averagable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||