com.rapidminer.operator.learner.tree
Class AbstractTreeLearner

java.lang.Object
  extended by com.rapidminer.tools.AbstractObservable<Operator>
      extended by com.rapidminer.operator.Operator
          extended by com.rapidminer.operator.learner.AbstractLearner
              extended by com.rapidminer.operator.learner.tree.AbstractTreeLearner
All Implemented Interfaces:
ConfigurationListener, PreviewListener, ResourceConsumer, CapabilityProvider, Learner, ParameterHandler, LoggingHandler, Observable<Operator>
Direct Known Subclasses:
DecisionStumpLearner, DecisionTreeLearner, ID3Learner, ID3NumericalLearner

public abstract class AbstractTreeLearner
extends AbstractLearner

This is the abstract super class for all decision tree learners. The actual type of the tree is determined by the criterion, e.g. using gain_ratio or Gini for CART / C4.5 and chi_squared for CHAID.

Author:
Sebastian Land, Ingo Mierswa

Field Summary
static java.lang.Class[] CRITERIA_CLASSES
           
static java.lang.String[] CRITERIA_NAMES
           
static int CRITERION_ACCURACY
           
static int CRITERION_GAIN_RATIO
           
static int CRITERION_GINI_INDEX
           
static int CRITERION_INFO_GAIN
           
static java.lang.String PARAMETER_CRITERION
          The parameter name for "Specifies the used criterion for selecting attributes and numerical splits.
static java.lang.String PARAMETER_MINIMAL_GAIN
          The parameter name for the minimal gain.
static java.lang.String PARAMETER_MINIMAL_LEAF_SIZE
          The parameter name for "The minimal size of all leaves.
static java.lang.String PARAMETER_MINIMAL_SIZE_FOR_SPLIT
          The parameter name for "The minimal size of all leaves.
 
Fields inherited from interface com.rapidminer.operator.learner.CapabilityProvider
PROPERTY_RAPIDMINER_GENERAL_CAPABILITIES_WARN
 
Constructor Summary
AbstractTreeLearner(OperatorDescription description)
           
 
Method Summary
protected  Criterion createCriterion(double minimalGain)
           
 java.lang.Class<? extends PredictionModel> getModelClass()
          This method might be overridden from subclasses in order to specify exactly which model class they use.
 java.util.List<ParameterType> getParameterTypes()
          Returns a list of ParameterTypes describing the parameters of this operator.
abstract  Pruner getPruner()
          Returns the pruner for this tree learner.
 SplitPreprocessing getSplitPreprocessing()
          The split preprocessing is applied before each new split The default implementation does nothing and simply returns the given example set.
abstract  java.util.List<Terminator> getTerminationCriteria(ExampleSet exampleSet)
          Returns all termination criteria.
protected abstract  TreeBuilder getTreeBuilder(ExampleSet exampleSet)
           
 Model learn(ExampleSet eSet)
          Trains a model.
 
Methods inherited from class com.rapidminer.operator.learner.AbstractLearner
canCalculateWeights, canEstimatePerformance, doWork, doWork, getEstimatedPerformance, getExampleSetInputPort, getOptimizationPerformance, getWeightCalculationError, getWeights, getWeights, onlyWarnForNonSufficientCapabilities, shouldAutoConnect, shouldCalculateWeights, shouldDeliverOptimizationPerformance, shouldEstimatePerformance
 
Methods inherited from class com.rapidminer.operator.Operator
acceptsInput, addError, addError, addValue, addWarning, apply, apply, assumePreconditionsSatisfied, checkAll, checkAllExcludingMetaData, checkDeprecations, checkForStop, checkIO, checkProperties, clear, clearErrorList, cloneOperator, collectErrors, createExperimentTree, createExperimentTree, createFromXML, createFromXML, createFromXML, createMarkedExperimentTree, createMarkedProcessTree, createProcessTree, createProcessTree, disconnectPorts, execute, fireUpdate, freeMemory, getAddOnlyAdditionalOutput, getApplyCount, getCompatibilityLevel, getDeliveredOutputClasses, getDeprecationInfo, getDesiredInputClasses, getDOMRepresentation, getEncoding, getErrorList, getExecutionUnit, getExperiment, getIncompatibleVersionChanges, getInput, getInput, getInput, getInputClasses, getInputDescription, getInputPorts, getIODescription, getLog, getLogger, getName, getNumberOfBreakpoints, getOperatorClassName, getOperatorDescription, getOutputClasses, getOutputPorts, getParameter, getParameterAsBoolean, getParameterAsChar, getParameterAsColor, getParameterAsDouble, getParameterAsFile, getParameterAsFile, getParameterAsInputStream, getParameterAsInt, getParameterAsMatrix, getParameterAsRepositoryLocation, getParameterAsString, getParameterHandler, getParameterList, getParameters, getParameterTupel, getParameterType, getParent, getPortOwner, getProcess, getResourceConsumptionEstimator, getRoot, getStartTime, getTransformer, getUserDescription, getValue, getValues, getXML, getXML, getXML, hasBreakpoint, hasBreakpoint, hasInput, inApplyLoop, isDebugMode, isDirty, isEnabled, isExpanded, isParallel, isParameterSet, isRunning, log, log, logError, logNote, logWarning, lookupOperator, makeDirty, makeDirtyOnUpdate, notifyRenaming, performAdditionalChecks, preAutoWire, processFinished, processStarts, producesOutput, propagateDirtyness, register, registerOperator, remove, removeAndKeepConnections, rename, resume, setBreakpoint, setCompatibilityLevel, setEnabled, setEnclosingProcess, setExpanded, setInput, setListParameter, setPairParameter, setParameter, setParameters, setUserDescription, shouldAutoConnect, shouldStopStandaloneExecution, toString, transformMetaData, unregisterOperator, updateExecutionOrder, walk, writeXML, writeXML
 
Methods inherited from class com.rapidminer.tools.AbstractObservable
addObserver, addObserverAsFirst, fireUpdate, removeObserver
 
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
 
Methods inherited from interface com.rapidminer.operator.learner.CapabilityProvider
supportsCapability
 

Field Detail

PARAMETER_CRITERION

public static final java.lang.String PARAMETER_CRITERION
The parameter name for "Specifies the used criterion for selecting attributes and numerical splits."

See Also:
Constant Field Values

PARAMETER_MINIMAL_SIZE_FOR_SPLIT

public static final java.lang.String PARAMETER_MINIMAL_SIZE_FOR_SPLIT
The parameter name for "The minimal size of all leaves."

See Also:
Constant Field Values

PARAMETER_MINIMAL_LEAF_SIZE

public static final java.lang.String PARAMETER_MINIMAL_LEAF_SIZE
The parameter name for "The minimal size of all leaves."

See Also:
Constant Field Values

PARAMETER_MINIMAL_GAIN

public static final java.lang.String PARAMETER_MINIMAL_GAIN
The parameter name for the minimal gain.

See Also:
Constant Field Values

CRITERIA_NAMES

public static final java.lang.String[] CRITERIA_NAMES

CRITERIA_CLASSES

public static final java.lang.Class[] CRITERIA_CLASSES

CRITERION_GAIN_RATIO

public static final int CRITERION_GAIN_RATIO
See Also:
Constant Field Values

CRITERION_INFO_GAIN

public static final int CRITERION_INFO_GAIN
See Also:
Constant Field Values

CRITERION_GINI_INDEX

public static final int CRITERION_GINI_INDEX
See Also:
Constant Field Values

CRITERION_ACCURACY

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

AbstractTreeLearner

public AbstractTreeLearner(OperatorDescription description)
Method Detail

getModelClass

public java.lang.Class<? extends PredictionModel> getModelClass()
Description copied from class: AbstractLearner
This method might be overridden from subclasses in order to specify exactly which model class they use. This is to ensure the proper postprocessing of some models like KernelModels (SupportVectorCounter) or TreeModels (Rule generation)

Overrides:
getModelClass in class AbstractLearner

getTerminationCriteria

public abstract java.util.List<Terminator> getTerminationCriteria(ExampleSet exampleSet)
                                                           throws OperatorException
Returns all termination criteria.

Throws:
OperatorException

getPruner

public abstract Pruner getPruner()
                          throws OperatorException
Returns the pruner for this tree learner. If this method returns null, pruning will be disabled.

Throws:
OperatorException

getSplitPreprocessing

public SplitPreprocessing getSplitPreprocessing()
The split preprocessing is applied before each new split The default implementation does nothing and simply returns the given example set. Subclasses might want to override this in order to perform some data preprocessing like random subset selections.


learn

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

Throws:
OperatorException

getTreeBuilder

protected abstract TreeBuilder getTreeBuilder(ExampleSet exampleSet)
                                       throws OperatorException
Throws:
OperatorException

createCriterion

protected Criterion createCriterion(double minimalGain)
                             throws OperatorException
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. ATTENTION! This will create new parameterTypes. For calling already existing parameter types use getParameters().getParameterTypes();

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


Copyright © 2001-2009 by Rapid-I