com.rapidminer.operator.learner.lazy
Class DefaultLearner

java.lang.Object
  extended by com.rapidminer.operator.Operator
      extended by com.rapidminer.operator.learner.AbstractLearner
          extended by com.rapidminer.operator.learner.lazy.DefaultLearner
All Implemented Interfaces:
ConfigurationListener, PreviewListener, Learner, ParameterHandler, LoggingHandler

public class DefaultLearner
extends AbstractLearner

This learner creates a model, that will simply predict a default value for all examples, i.e. the average or median of the true labels (or the mode in case of classification) or a fixed specified value. This learner can be used to compare the results of "real" learning schemes with guessing.

Author:
Stefan Rueping, Ingo Mierswa
See Also:
DefaultModel

Field Summary
static int AVERAGE
           
static int CONSTANT
           
static int MEDIAN
           
static int MODE
           
static java.lang.String PARAMETER_CONSTANT
          The parameter name for "Value returned when method = constant.
static java.lang.String PARAMETER_METHOD
          The parameter name for "The method to compute the default.
 
Fields inherited from class com.rapidminer.operator.learner.AbstractLearner
PROPERTY_RAPIDMINER_GENERAL_CAPABILITIES_WARN
 
Constructor Summary
DefaultLearner(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.
 boolean supportsCapability(LearnerCapability lc)
          Checks for Learner capabilities.
 
Methods inherited from class com.rapidminer.operator.learner.AbstractLearner
apply, getEstimatedPerformance, getInputClasses, getInputDescription, getOptimizationPerformance, getOutputClasses, getWeights, onlyWarnForNonSufficientCapabilities, shouldCalculateWeights, shouldDeliverOptimizationPerformance, shouldEstimatePerformance
 
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, 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, 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
 
Methods inherited from interface com.rapidminer.operator.learner.Learner
getName
 

Field Detail

PARAMETER_METHOD

public static final java.lang.String PARAMETER_METHOD
The parameter name for "The method to compute the default."

See Also:
Constant Field Values

PARAMETER_CONSTANT

public static final java.lang.String PARAMETER_CONSTANT
The parameter name for "Value returned when method = constant."

See Also:
Constant Field Values

MEDIAN

public static final int MEDIAN
See Also:
Constant Field Values

AVERAGE

public static final int AVERAGE
See Also:
Constant Field Values

MODE

public static final int MODE
See Also:
Constant Field Values

CONSTANT

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

DefaultLearner

public DefaultLearner(OperatorDescription description)
Method Detail

supportsCapability

public boolean supportsCapability(LearnerCapability lc)
Description copied from interface: Learner
Checks for Learner capabilities. Should return true if the given capability is supported.


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