com.rapidminer.operator.performance
Class PerformanceCriterion

java.lang.Object
  extended by com.rapidminer.operator.AbstractIOObject
      extended by com.rapidminer.operator.ResultObjectAdapter
          extended by com.rapidminer.tools.math.Averagable
              extended by com.rapidminer.operator.performance.PerformanceCriterion
All Implemented Interfaces:
IOObject, ResultObject, Readable, Reportable, LoggingHandler, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<PerformanceCriterion>
Direct Known Subclasses:
EstimatedPerformance, MeasuredPerformance

public abstract class PerformanceCriterion
extends Averagable
implements java.lang.Comparable<PerformanceCriterion>

Each PerformanceCriterion contains a method to compute this criterion on a given set of examples, each which has to have a real and a predicted label.

PerformanceCriteria must implement the compareTo method in a way that allows Collections to sort the criteria in ascending order and determine the best as the maximum.

Author:
Ingo Mierswa
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.rapidminer.operator.AbstractIOObject
AbstractIOObject.InputStreamProvider
 
Constructor Summary
PerformanceCriterion()
           
PerformanceCriterion(PerformanceCriterion o)
          Clone constructor.
 
Method Summary
 int compareTo(PerformanceCriterion o)
          The semantics of this method follow the specification in the interface java.lang.Comparable in the following way: Two objects of this class are equal if their getFitness() values are equal.
abstract  java.lang.String getDescription()
          Returns a description of the performance criterion.
abstract  double getExampleCount()
          Returns the number of data points which was used to determine the criterion value.
abstract  double getFitness()
          Returns the fitness depending on the value.
 double getMaxFitness()
          Returns the maximum fitness.
 
Methods inherited from class com.rapidminer.tools.math.Averagable
buildAverage, buildSingleAverage, clone, cloneAveragable, formatPercent, getAverage, getAverageCount, getExtension, getFileDescription, getMakroAverage, getMakroStandardDeviation, getMakroVariance, getMikroAverage, getMikroStandardDeviation, getMikroVariance, 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

PerformanceCriterion

public PerformanceCriterion()

PerformanceCriterion

public PerformanceCriterion(PerformanceCriterion o)
Clone constructor.

Method Detail

getDescription

public abstract java.lang.String getDescription()
Returns a description of the performance criterion. This description is used for GUI purposes and automatic parameter type creation for the PerformanceEvaluator operator.


getExampleCount

public abstract double getExampleCount()
Returns the number of data points which was used to determine the criterion value. If the criterion does not use example weights (or no weight was given) then the returned value will be an integer. Otherwise, the returned value is the sum of all example weights.


getFitness

public abstract double getFitness()

Returns 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.


getMaxFitness

public double getMaxFitness()
Returns the maximum fitness. The default implementation resturns POSITIVE_INFINITY, subclasses may override this to allow feature operators to end the optimization if the maximum was reached.


compareTo

public int compareTo(PerformanceCriterion o)
The semantics of this method follow the specification in the interface java.lang.Comparable in the following way: Two objects of this class are equal if their getFitness() values are equal. The return value is 0 in this case. If the specified object is not an object of this class, a ClassCastException is thrown. If the given object has fitness bigger than this object, the return value is -1. If the given object has fitness smaller than this object, 1 is returned. No characteristics beside the fitness are used to compare two objects of this class.

Specified by:
compareTo in interface java.lang.Comparable<PerformanceCriterion>
Parameters:
o - Object of this class to compare this object to.
Returns:
-1, 0 or 1 if the given object is greater than, equal to, or less than this object.


Copyright © 2001-2009 by Rapid-I