com.rapidminer.operator.performance
Class RankCorrelation

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
                  extended by com.rapidminer.operator.performance.MeasuredPerformance
                      extended by com.rapidminer.operator.performance.RankCorrelation
All Implemented Interfaces:
IOObject, ResultObject, Readable, Reportable, LoggingHandler, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<PerformanceCriterion>

public class RankCorrelation
extends MeasuredPerformance

Computes either the Spearman (rho) or Kendall (tau-b) rank correlation between the actual label and predicted values of an example set. Since ranking is involved, neither correlation is averageable.

Author:
Paul Rubin
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.rapidminer.operator.AbstractIOObject
AbstractIOObject.InputStreamProvider
 
Field Summary
static java.lang.String[] DESCRIPTIONS
           
static java.lang.String[] NAMES
           
static int RHO
           
static int TAU
           
 
Constructor Summary
RankCorrelation()
          Default constructor
RankCorrelation(int type)
          Constructor with user-specified choice of correlation coefficient.
RankCorrelation(RankCorrelation rc)
           
 
Method Summary
protected  void buildSingleAverage(Averagable averagable)
          Averaging across instances of RankCorrelation is unsupported (?)
 void countExample(Example example)
          Does nothing.
 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 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.
 void startCounting(ExampleSet eSet, boolean useExampleWeights)
          Computes whichever of rho and tau was requested.
 
Methods inherited from class com.rapidminer.operator.performance.MeasuredPerformance
startCounting
 
Methods inherited from class com.rapidminer.operator.performance.PerformanceCriterion
compareTo, getMaxFitness
 
Methods inherited from class com.rapidminer.tools.math.Averagable
buildAverage, clone, cloneAveragable, formatPercent, getAverage, getAverageCount, getExtension, getFileDescription, getMakroAverage, getMakroStandardDeviation, getMakroVariance, getMikroStandardDeviation, 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
 

Field Detail

NAMES

public static final java.lang.String[] NAMES

DESCRIPTIONS

public static final java.lang.String[] DESCRIPTIONS

RHO

public static final int RHO
See Also:
Constant Field Values

TAU

public static final int TAU
See Also:
Constant Field Values
Constructor Detail

RankCorrelation

public RankCorrelation()
Default constructor


RankCorrelation

public RankCorrelation(int type)
Constructor with user-specified choice of correlation coefficient. User specifies RHO or TAU.

Parameters:
type - coefficient type with coefficient choice

RankCorrelation

public RankCorrelation(RankCorrelation rc)
Method Detail

countExample

public void countExample(Example example)
Does nothing. Everything is done in startCounting(ExampleSet, boolean).

Specified by:
countExample in class MeasuredPerformance

getDescription

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

Specified by:
getDescription in class PerformanceCriterion

getExampleCount

public double getExampleCount()
Description copied from class: PerformanceCriterion
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.

Specified by:
getExampleCount in class PerformanceCriterion

getFitness

public double getFitness()
Description copied from class: PerformanceCriterion

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.

Specified by:
getFitness in class PerformanceCriterion

buildSingleAverage

protected void buildSingleAverage(Averagable averagable)
Averaging across instances of RankCorrelation is unsupported (?) For now just build the usual average by summing up the values...

Specified by:
buildSingleAverage in class Averagable

getMikroAverage

public double getMikroAverage()
Description copied from class: Averagable
Returns the (current) value of the averagable (the average itself). If the method Averagable.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).

Specified by:
getMikroAverage in class Averagable

getMikroVariance

public double getMikroVariance()
Description copied from class: Averagable
Returns the variance of the averagable. The returned value must not be negative. If the averagable does not define a variance this method should return Double.NaN.

Specified by:
getMikroVariance in class Averagable

getName

public java.lang.String getName()
Description copied from class: Averagable
Returns the name of this averagable. The returned string should only contain lowercase letters and underscore (RapidMiner parameter format) since the names will be automatically used for GUI purposes.

Specified by:
getName in interface ResultObject
Specified by:
getName in class Averagable

startCounting

public void startCounting(ExampleSet eSet,
                          boolean useExampleWeights)
                   throws OperatorException
Computes whichever of rho and tau was requested.

Overrides:
startCounting in class MeasuredPerformance
Throws:
OperatorException


Copyright © 2001-2009 by Rapid-I