com.rapidminer.operator.postprocessing
Class PlattScaling

java.lang.Object
  extended by com.rapidminer.operator.Operator
      extended by com.rapidminer.operator.postprocessing.PlattScaling
All Implemented Interfaces:
ConfigurationListener, PreviewListener, ParameterHandler, LoggingHandler

public class PlattScaling
extends Operator

A scaling operator, applying the original algorithm by Platt (1999) to turn confidence scores of boolean classifiers into probability estimates. Unlike the original version this operator assumes that the confidence scores are already in the interval of [0,1], as e.g. given for the RapidMiner boosting operators. The crude estimates are then transformed into log odds, and scaled by the original transformation of Platt. The operator assumes a model and an example set for scaling. It outputs a PlattScalingModel, that contains both, the supplied model and the scaling step. If the example set contains a weight attribute, then this operator is able to fit a model to the weighted examples.

Author:
Martin Scholz

Constructor Summary
PlattScaling(OperatorDescription description)
           
 
Method Summary
 IOObject[] apply()
          Implement this method in subclasses.
static PlattParameters computeParameters(ExampleSet exampleSet, Attribute label)
          Implementation of Platt' scaling algorithm as found in [Platt, 1999].
 java.lang.Class<?>[] getInputClasses()
          Returns an array with two elements: ExampleSet and Model.
static double getLogOddsPosConfidence(double originalConfidence)
          Translates confidence scores in [0, 1] to those originally expected by Platt's scaling, where positive values result in positive predictions, and where the absolute value indicates the confidence in the prediction.
 java.lang.Class<?>[] getOutputClasses()
          Returns an array with one element; Model
 boolean supportsCapability(LearnerCapability lc)
           
 
Methods inherited from class com.rapidminer.operator.Operator
addError, addValue, addWarning, apply, checkDeprecations, checkForStop, checkIO, checkProperties, clearErrorList, cloneOperator, createExperimentTree, createExperimentTree, createFromXML, createMarkedExperimentTree, createMarkedProcessTree, createProcessTree, createProcessTree, getAddOnlyAdditionalOutput, getApplyCount, getDeliveredOutputClasses, getDeprecationInfo, getDesiredInputClasses, getEncoding, getErrorList, getExperiment, getInnerOperatorsXML, getInput, getInput, getInput, getInputDescription, getIOContainerForInApplyLoopBreakpoint, getIODescription, getLog, getName, getOperatorClassName, getOperatorDescription, getParameter, getParameterAsBoolean, getParameterAsColor, getParameterAsDouble, getParameterAsFile, getParameterAsFile, getParameterAsInputStream, getParameterAsInt, getParameterAsMatrix, getParameterAsString, getParameterList, getParameters, getParameterType, getParameterTypes, getParent, getProcess, getStartTime, getStatus, getUserDescription, getValue, getValues, getXML, hasBreakpoint, hasBreakpoint, hasInput, inApplyLoop, isDebugMode, isEnabled, isExpanded, isParallel, isParameterSet, log, logError, logNote, logWarning, performAdditionalChecks, processFinished, processStarts, register, registerOperator, remove, rename, resume, setApplyCount, setBreakpoint, setEnabled, setExpanded, setInput, setListParameter, setOperatorParameters, setParameter, setParameters, setParent, setUserDescription, toString, unregisterOperator, writeXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PlattScaling

public PlattScaling(OperatorDescription description)
Method Detail

supportsCapability

public boolean supportsCapability(LearnerCapability lc)

getInputClasses

public java.lang.Class<?>[] getInputClasses()
Returns an array with two elements: ExampleSet and Model.

Specified by:
getInputClasses in class Operator

getOutputClasses

public java.lang.Class<?>[] getOutputClasses()
Returns an array with one element; Model

Specified by:
getOutputClasses in class Operator

apply

public IOObject[] apply()
                 throws OperatorException
Description copied from class: Operator
Implement this method in subclasses.

Specified by:
apply in class Operator
Throws:
OperatorException

computeParameters

public static PlattParameters computeParameters(ExampleSet exampleSet,
                                                Attribute label)
Implementation of Platt' scaling algorithm as found in [Platt, 1999].

Parameters:
exampleSet - the example set for finding the model parameters. It needs to contain a predicted label and confidence scores. Please note, that the confidence values are expected to range from 0 to 1, e.g. already take the form of coarse probability estimates.
Returns:
an object containing the parameters A and B of Platt's scaling

getLogOddsPosConfidence

public static double getLogOddsPosConfidence(double originalConfidence)
Translates confidence scores in [0, 1] to those originally expected by Platt's scaling, where positive values result in positive predictions, and where the absolute value indicates the confidence in the prediction.



Copyright © 2001-2009 by Rapid-I