com.rapidminer.operator.learner.meta
Class CostBasedThresholdLearner

java.lang.Object
  extended by com.rapidminer.operator.Operator
      extended by com.rapidminer.operator.OperatorChain
          extended by com.rapidminer.operator.learner.meta.AbstractMetaLearner
              extended by com.rapidminer.operator.learner.meta.CostBasedThresholdLearner
All Implemented Interfaces:
ConfigurationListener, PreviewListener, Learner, ParameterHandler, LoggingHandler

public class CostBasedThresholdLearner
extends AbstractMetaLearner

This operator uses a set of class weights and also allows a weight for the fact that an example is not classified at all (marked as unknown). Based on the predictions of the model of the inner learner this operator optimized a set of thresholds regarding the defined weights.

This operator might be very useful in cases where it is better to not classify an example then to classify it in a wrong way. This way, it is often possible to get very high accuracies for the remaining examples (which are actually classified) for the cost of having some examples which must still be manually classified.

Author:
Ingo Mierswa

Field Summary
static java.lang.String PARAMETER_CLASS_WEIGHTS
          The parameter name for "The weights for all classes (first column: class names, second column: weight), empty: using 1 for all classes.
static java.lang.String PARAMETER_LOCAL_RANDOM_SEED
          The parameter name for "Use the given random seed instead of global random numbers (-1: use global)"
static java.lang.String PARAMETER_NUMBER_OF_ITERATIONS
          The parameter name for "Defines the number of optimization iterations.
static java.lang.String PARAMETER_PREDICT_UNKNOWN_COSTS
          The parameter name for "Use this cost value for predicting an example as unknown (-1: use same costs as for correct class).
static java.lang.String PARAMETER_TRAINING_RATIO
          The parameter name for "Use this amount of input data for model learning and the rest for threshold optimization.
 
Constructor Summary
CostBasedThresholdLearner(OperatorDescription description)
           
 
Method Summary
 java.util.List<ParameterType> getParameterTypes()
          Returns a list of ParameterTypes describing the parameters of this operator.
 Model learn(ExampleSet exampleSet)
          Trains a model.
 
Methods inherited from class com.rapidminer.operator.learner.meta.AbstractMetaLearner
apply, applyInnerLearner, getEstimatedPerformance, getInnerOperatorCondition, getInputClasses, getInputDescription, getMaxNumberOfInnerOperators, getMinNumberOfInnerOperators, getOutputClasses, getWeights, shouldCalculateWeights, shouldEstimatePerformance, supportsCapability
 
Methods inherited from class com.rapidminer.operator.OperatorChain
addAddListener, addOperator, addOperator, checkDeprecations, checkIO, checkNumberOfInnerOperators, checkProperties, clearErrorList, cloneOperator, createExperimentTree, createProcessTree, getAllInnerOperators, getIndexOfOperator, getInnerOperatorForName, getInnerOperatorsXML, getNumberOfAllOperators, getNumberOfOperators, getOperator, getOperatorFromAll, getOperators, performAdditionalChecks, processFinished, processStarts, registerOperator, removeAddListener, removeOperator, shouldAddNonConsumedInput, shouldReturnInnerOutput, unregisterOperator
 
Methods inherited from class com.rapidminer.operator.Operator
addError, addValue, addWarning, apply, checkForStop, createExperimentTree, createFromXML, createMarkedExperimentTree, createMarkedProcessTree, createProcessTree, getAddOnlyAdditionalOutput, getApplyCount, getDeliveredOutputClasses, getDeprecationInfo, getDesiredInputClasses, getEncoding, getErrorList, getExperiment, getInput, getInput, getInput, getIOContainerForInApplyLoopBreakpoint, getIODescription, getLog, getName, getOperatorClassName, getOperatorDescription, getParameter, getParameterAsBoolean, getParameterAsColor, getParameterAsDouble, getParameterAsFile, getParameterAsFile, getParameterAsInputStream, getParameterAsInt, getParameterAsMatrix, getParameterAsString, getParameterList, getParameters, getParameterType, getParent, getProcess, getStartTime, getStatus, getUserDescription, getValue, getValues, getXML, hasBreakpoint, hasBreakpoint, hasInput, inApplyLoop, isDebugMode, isEnabled, isExpanded, isParallel, isParameterSet, log, logError, logNote, logWarning, register, remove, rename, resume, setApplyCount, setBreakpoint, setEnabled, setExpanded, setInput, setListParameter, setOperatorParameters, setParameter, setParameters, setParent, setUserDescription, toString, writeXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.rapidminer.operator.learner.Learner
getName
 

Field Detail

PARAMETER_CLASS_WEIGHTS

public static final java.lang.String PARAMETER_CLASS_WEIGHTS
The parameter name for "The weights for all classes (first column: class names, second column: weight), empty: using 1 for all classes. The costs for not classifying at all are defined with class name '?'."

See Also:
Constant Field Values

PARAMETER_PREDICT_UNKNOWN_COSTS

public static final java.lang.String PARAMETER_PREDICT_UNKNOWN_COSTS
The parameter name for "Use this cost value for predicting an example as unknown (-1: use same costs as for correct class)."

See Also:
Constant Field Values

PARAMETER_TRAINING_RATIO

public static final java.lang.String PARAMETER_TRAINING_RATIO
The parameter name for "Use this amount of input data for model learning and the rest for threshold optimization."

See Also:
Constant Field Values

PARAMETER_NUMBER_OF_ITERATIONS

public static final java.lang.String PARAMETER_NUMBER_OF_ITERATIONS
The parameter name for "Defines the number of optimization iterations."

See Also:
Constant Field Values

PARAMETER_LOCAL_RANDOM_SEED

public static final java.lang.String PARAMETER_LOCAL_RANDOM_SEED
The parameter name for "Use the given random seed instead of global random numbers (-1: use global)"

See Also:
Constant Field Values
Constructor Detail

CostBasedThresholdLearner

public CostBasedThresholdLearner(OperatorDescription description)
Method Detail

learn

public Model learn(ExampleSet exampleSet)
            throws OperatorException
Description copied from interface: Learner
Trains a model. This method should be called by apply() and is implemented by subclasses.

Throws:
OperatorException

getParameterTypes

public java.util.List<ParameterType> getParameterTypes()
Description copied from class: Operator
Returns a list of ParameterTypes describing the parameters of this operator. The default implementation returns an empty list if no input objects can be retained and special parameters for those input objects which can be prevented from being consumed.

Specified by:
getParameterTypes in interface ParameterHandler
Overrides:
getParameterTypes in class Operator


Copyright © 2001-2009 by Rapid-I