|
|||||||||
| 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.MultiClassificationPerformance
public class MultiClassificationPerformance
Measures the accuracy and classification error for both binary classification problems and multi class problems. Additionally, this performance criterion can also compute the kappa statistics for multi class problems. This is calculated as k = (P(A) - P(E)) / (1 - P(E)) with P(A) = (diagonal sum / number of examples) and P(E) = sum over i of ((sum of i-th row * sum of i-th column) / n to the power of the number of classes).
| Field Summary | |
|---|---|
static int |
ACCURACY
Indicates accuracy. |
private java.lang.String[] |
classNames
The class names of the label. |
private int[][] |
counter
The counter for true labels and the prediction. |
static java.lang.String[] |
DESCRIPTION
The descriptions of the criteria. |
static int |
ERROR
Indicates classification error. |
static int |
KAPPA
Indicates kappa statistics. |
static java.lang.String[] |
NAME
The names of the criteria. |
private int |
type
The type of this performance: accuracy or classification error. |
static int |
UNDEFINED
Indicates an undefined type (should not happen). |
| Constructor Summary | |
|---|---|
MultiClassificationPerformance()
Creates a MultiClassificationPerformance with undefined type. |
|
MultiClassificationPerformance(int type)
Creates a MultiClassificationPerformance with the given type. |
|
| 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)
Increases the prediction value in the matrix. |
boolean |
formatPercent()
Returns true. |
java.lang.String |
getDescription()
Returns the description. |
int |
getExampleCount()
Returns the number of data points which was used to determine the criterion value. |
double |
getFitness()
Returns the accuracy or 1 - error. |
double |
getMaxFitness()
Returns 1. |
double |
getMikroAverage()
Returns either the accuracy or the classification error. |
double |
getMikroVariance()
Returns the variance of the averagable. |
java.lang.String |
getName()
Returns the name. |
static MultiClassificationPerformance |
newInstance(java.lang.String name)
Creates a MultiClassificationPerformance with the given type. |
void |
readCriterionData(java.io.BufferedReader in)
Reads the performance data from the given reader. |
void |
startCounting(ExampleSet eSet)
Initializes the criterion and sets the label. |
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 UNDEFINED
public static final int ACCURACY
public static final int ERROR
public static final int KAPPA
public static final java.lang.String[] NAME
public static final java.lang.String[] DESCRIPTION
private int[][] counter
private java.lang.String[] classNames
private int type
| Constructor Detail |
|---|
public MultiClassificationPerformance()
public MultiClassificationPerformance(int type)
| Method Detail |
|---|
public static MultiClassificationPerformance 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 PerformanceCriterionpublic void startCounting(ExampleSet eSet)
startCounting in class MeasuredPerformancepublic void countExample(Example example)
countExample in class MeasuredPerformancepublic double getMikroAverage()
getMikroAverage in class Averagablepublic boolean formatPercent()
formatPercent in class Averagablepublic double getMikroVariance()
Averagable
getMikroVariance in class Averagablepublic java.lang.String getName()
getName in interface ResultObjectgetName in class Averagablepublic java.lang.String getDescription()
getDescription in class MeasuredPerformancepublic double getFitness()
getFitness in class PerformanceCriterionpublic double getMaxFitness()
getMaxFitness in class PerformanceCriterionprotected 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 | ||||||||