|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rapidminer.operator.AbstractIOObject
com.rapidminer.operator.ResultObjectAdapter
com.rapidminer.tools.math.Averagable
com.rapidminer.operator.performance.PerformanceCriterion
com.rapidminer.operator.performance.MeasuredPerformance
com.rapidminer.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 | |
|---|---|
static java.lang.String[] |
DESCRIPTIONS
|
static int |
F_MEASURE
|
static int |
FALLOUT
|
static int |
FALSE_NEGATIVE
|
static int |
FALSE_POSITIVE
|
static int |
LIFT
|
static java.lang.String[] |
NAMES
|
static int |
NEGATIVE_PREDICTIVE_VALUE
|
static int |
POSITIVE_PREDICTIVE_VALUE
|
static int |
PRECISION
|
static int |
PSEP
|
static int |
RECALL
|
static int |
SENSITIVITY
|
static int |
SPECIFICITY
|
static int |
TRUE_NEGATIVE
|
static int |
TRUE_POSITIVE
|
static int |
YOUDEN
|
| Constructor Summary | |
|---|---|
BinaryClassificationPerformance()
|
|
BinaryClassificationPerformance(BinaryClassificationPerformance o)
|
|
BinaryClassificationPerformance(int type)
|
|
BinaryClassificationPerformance(int type,
double[][] counter)
For test cases only. |
|
| Method Summary | |
|---|---|
void |
buildSingleAverage(Averagable performance)
This method should build the average of this and another averagable of the same type. |
void |
countExample(Example example)
Counts a single example, e.g. by summing up errors. |
void |
finishReporting()
|
boolean |
formatPercent()
Indicates wether or not percentage format should be used in the Averagable.toString() method. |
java.lang.String |
getCell(int row,
int column)
|
java.lang.String |
getColumnName(int columnIndex)
|
int |
getColumnNumber()
|
java.lang.String |
getDescription()
Returns a description of the performance criterion. |
double |
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. |
int |
getRowNumber()
|
java.awt.Component |
getVisualizationComponent(IOContainer ioContainer)
This implementation returns a confusion matrix viewer based on a JTable. |
boolean |
isFirstColumnHeader()
|
boolean |
isFirstLineHeader()
|
static BinaryClassificationPerformance |
newInstance(java.lang.String name)
|
void |
prepareReporting()
|
void |
startCounting(ExampleSet eSet,
boolean useExampleWeights)
Initializes the criterion. |
java.lang.String |
toString()
|
| Methods inherited from class com.rapidminer.operator.performance.MeasuredPerformance |
|---|
startCounting |
| Methods inherited from class com.rapidminer.operator.performance.PerformanceCriterion |
|---|
compareTo |
| Methods inherited from class com.rapidminer.tools.math.Averagable |
|---|
buildAverage, clone, cloneAveragable, getAverage, getAverageCount, getExtension, getFileDescription, getMakroAverage, getMakroStandardDeviation, getMakroVariance, getMikroStandardDeviation, getStandardDeviation, getVariance, setAverageCount |
| Methods inherited from class com.rapidminer.operator.ResultObjectAdapter |
|---|
addAction, getActions, getResultIcon, isSavable, log, logError, logNote, logWarning, save, toHTML, toResultString |
| Methods inherited from class com.rapidminer.operator.AbstractIOObject |
|---|
copy, getLog, getSource, initWriting, read, setLoggingHandler, setSource, write |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.rapidminer.operator.IOObject |
|---|
copy, getLog, getSource, setLoggingHandler, setSource, 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
public static final int SENSITIVITY
public static final int SPECIFICITY
public static final int YOUDEN
public static final int POSITIVE_PREDICTIVE_VALUE
public static final int NEGATIVE_PREDICTIVE_VALUE
public static final int PSEP
public static final java.lang.String[] NAMES
public static final java.lang.String[] DESCRIPTIONS
| Constructor Detail |
|---|
public BinaryClassificationPerformance()
public BinaryClassificationPerformance(BinaryClassificationPerformance o)
public BinaryClassificationPerformance(int type)
public BinaryClassificationPerformance(int type,
double[][] counter)
| Method Detail |
|---|
public static BinaryClassificationPerformance newInstance(java.lang.String name)
public double getExampleCount()
PerformanceCriterion
getExampleCount in class PerformanceCriterion
public void startCounting(ExampleSet eSet,
boolean useExampleWeights)
throws OperatorException
MeasuredPerformance
startCounting in class MeasuredPerformanceOperatorExceptionpublic void countExample(Example example)
MeasuredPerformance
countExample in class MeasuredPerformancepublic double getMikroAverage()
AveragableAveragable.buildSingleAverage(Averagable) was used, this method must return the
micro average from both (or more) criteria. This is usually achieved by
correctly implementing Averagable.buildSingleAverage(Averagable).
getMikroAverage in class Averagablepublic double getFitness()
PerformanceCriterionReturns the fitness depending on the value. The fitness values will be used for all optimization purposes (feature space transformations, parameter optimizations...) and must always be maximized. Hence, if your criterion is better the smaller the value is you should return something like (-1 * value) or (1 / value).
Subclasses should use
Averagable.getAverage() instead of Averagable.getMikroAverage() in this method
since usually the makro average (if available) should be optmized instead
of the mikro average. The mikro average should only be used in the (rare)
cases where no makro average is available but this is automatically done
returned by Averagable.getAverage() in these cases.
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()
PerformanceCriterionPerformanceEvaluator operator.
getDescription in class PerformanceCriterionpublic boolean formatPercent()
AveragableAveragable.toString() method. The default implementation returns false.
formatPercent in class Averagablepublic void buildSingleAverage(Averagable performance)
AveragableAveragable.getMikroAverage() should return the
average of this and the given averagable. Hence, this method is used to build
the actual micro average value of two criteria. Please refer to
SimpleCriterion for a simple
implementation example.
buildSingleAverage in class Averagablepublic java.lang.String toString()
toString in interface ReadabletoString in class Averagablepublic java.awt.Component getVisualizationComponent(IOContainer ioContainer)
getVisualizationComponent in interface ResultObjectgetVisualizationComponent in class Averagablepublic void prepareReporting()
prepareReporting in interface Tableablepublic void finishReporting()
finishReporting in interface Tableablepublic java.lang.String getColumnName(int columnIndex)
getColumnName in interface Tableable
public java.lang.String getCell(int row,
int column)
getCell in interface Tableablepublic int getColumnNumber()
getColumnNumber in interface Tableablepublic int getRowNumber()
getRowNumber in interface Tableablepublic boolean isFirstLineHeader()
isFirstLineHeader in interface Tableablepublic boolean isFirstColumnHeader()
isFirstColumnHeader in interface Tableable
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||