|
||||||||||
| 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.SimpleCriterion
public abstract class SimpleCriterion
Simple criteria are those which error can be counted for each example and can
be averaged by the number of examples. Since errors should be minimized, the
fitness is calculated as -1 multiplied by the the error.
Subclasses might also want to implement the method
transform(double) which applies a transformation on the value
sum divided by the number of counted examples. This is for example usefull in
case of root_means_squared error. All subclasses can be used for both
regression and classification problems. In case of classification the
confidence value for the desired true label is used as prediction.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.rapidminer.operator.AbstractIOObject |
|---|
AbstractIOObject.InputStreamProvider |
| Constructor Summary | |
|---|---|
SimpleCriterion()
|
|
SimpleCriterion(SimpleCriterion sc)
|
|
| Method Summary | |
|---|---|
void |
buildSingleAverage(Averagable performance)
This method should build the average of this and another averagable of the same type. |
protected abstract double |
countExample(double label,
double predictedLabel)
Subclasses must count the example and return the value to sum up. |
void |
countExample(Example example)
Invokes countExample(double, double) and counts the
deviation. |
protected void |
countExampleWithWeight(double deviation,
double weight)
|
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 0.0. |
double |
getMikroAverage()
Returns the (current) value of the averagable (the average itself). |
double |
getMikroVariance()
Returns the variance of the averagable. |
void |
startCounting(ExampleSet eset,
boolean useExampleWeights)
Initializes the criterion. |
protected double |
transform(double value)
Simply returns the given value. |
| Methods inherited from class com.rapidminer.operator.performance.MeasuredPerformance |
|---|
startCounting |
| Methods inherited from class com.rapidminer.operator.performance.PerformanceCriterion |
|---|
compareTo, getDescription |
| Methods inherited from class com.rapidminer.tools.math.Averagable |
|---|
buildAverage, clone, cloneAveragable, formatPercent, getAverage, getAverageCount, getExtension, getFileDescription, getMakroAverage, getMakroStandardDeviation, getMakroVariance, getMikroStandardDeviation, getName, getStandardDeviation, getVariance, isInTargetEncoding, setAverageCount, toString |
| Methods inherited from class com.rapidminer.operator.ResultObjectAdapter |
|---|
addAction, getActions, getAnnotations, getResultIcon, log, log, logError, logNote, logWarning, toHTML, toResultString |
| Methods inherited from class com.rapidminer.operator.AbstractIOObject |
|---|
appendOperatorToHistory, copy, getLog, getProcessingHistory, getSource, initWriting, read, read, read, 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 |
|---|
appendOperatorToHistory, copy, getLog, getProcessingHistory, getSource, setLoggingHandler, setSource, write |
| Constructor Detail |
|---|
public SimpleCriterion()
public SimpleCriterion(SimpleCriterion sc)
| Method Detail |
|---|
public double getExampleCount()
PerformanceCriterion
getExampleCount in class PerformanceCriterionpublic void countExample(Example example)
countExample(double, double) and counts the
deviation. In case of a nominal label the confidence of the desired true
label is used as prediction. For regression problems the usual predicted
label is used.
countExample in class MeasuredPerformance
protected abstract double countExample(double label,
double predictedLabel)
protected double transform(double value)
protected void countExampleWithWeight(double deviation,
double weight)
public 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 getMikroVariance()
Averagable
getMikroVariance in class Averagable
public void startCounting(ExampleSet eset,
boolean useExampleWeights)
throws OperatorException
MeasuredPerformance
startCounting in class MeasuredPerformanceOperatorExceptionpublic 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()
getMaxFitness in class PerformanceCriterionpublic 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 Averagable
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||