com.rapidminer.operator.learner.meta
Class AbstractMetaLearner

java.lang.Object
  extended by com.rapidminer.tools.AbstractObservable<Operator>
      extended by com.rapidminer.operator.Operator
          extended by com.rapidminer.operator.OperatorChain
              extended by com.rapidminer.operator.learner.meta.AbstractMetaLearner
All Implemented Interfaces:
ConfigurationListener, PreviewListener, ResourceConsumer, CapabilityProvider, Learner, ParameterHandler, LoggingHandler, Observable<Operator>
Direct Known Subclasses:
AdaBoost, AdditiveRegression, Bagging, BayBoostStream, BayesianBoosting, Binary2MultiClassLearner, ClassificationByRegression, CostBasedThresholdLearner, HierarchicalLearner, HierarchicalMultiClassLearner, MetaCost, MultiwayDecisionTree, RelativeRegression, TransformedRegression, Tree2RuleConverter

public abstract class AbstractMetaLearner
extends OperatorChain
implements Learner

A MetaLearner is an operator that encapsulates one or more learning steps to build its model. New meta learning schemes should extend this class to support the same parameters as other learners. The main purpose of this class is to perform some compatibility checks.

Author:
Ingo Mierswa

Field Summary
protected  InputPort exampleSetInput
           
protected  InputPort innerModelSink
           
 
Fields inherited from interface com.rapidminer.operator.learner.CapabilityProvider
PROPERTY_RAPIDMINER_GENERAL_CAPABILITIES_WARN
 
Constructor Summary
AbstractMetaLearner(OperatorDescription description)
           
 
Method Summary
protected  Model applyInnerLearner(ExampleSet exampleSet)
          This is a convenience method to apply the inner operators and return the model which must be output of the last operator.
 void doWork()
          Trains a model using an ExampleSet from the input.
protected  void executeInnerLearner()
           
 PerformanceVector getEstimatedPerformance()
          The default implementation throws an exception.
 InputPort getInnerModelSink()
           
 OutputPort getModelOutputPort()
           
 InputPort getTrainingSetInputPort()
           
 AttributeWeights getWeights(ExampleSet exampleSet)
          Returns the calculated weight vectors.
protected  MetaData modifyExampleSetMetaData(ExampleSetMetaData unmodifiedMetaData)
          This method can be used by subclasses to additionally change the example set meta data delivered to the inner learner
protected  MetaData modifyGeneratedModelMetaData(PredictionModelMetaData unmodifiedMetaData)
          Modifies the meta data of the generated model.
 boolean shouldAutoConnect(OutputPort port)
          By default, all ports will be auto-connected by ExecutionUnit.autoWire(CompatibilityLevel, boolean, boolean).
 boolean shouldCalculateWeights()
          Returns true if the user wants to calculate feature weights (depending on a parameter).
 boolean shouldEstimatePerformance()
          Returns true if the user wants to estimate the performance (depending on a parameter).
 
Methods inherited from class com.rapidminer.operator.OperatorChain
addOperator, addOperator, addSubprocess, areSubprocessesExtendable, assumePreconditionsSatisfied, checkDeprecations, checkIO, checkNumberOfInnerOperators, checkProperties, clear, cloneOperator, collectErrors, createProcessTree, createSubprocess, freeMemory, getAllInnerOperators, getAllInnerOperatorsAndMe, getImmediateChildren, getIndexOfOperator, getInnerOperatorCondition, getMaxNumberOfInnerOperators, getMinNumberOfInnerOperators, getNumberOfAllOperators, getNumberOfOperators, getNumberOfSubprocesses, getOperator, getOperatorFromAll, getOperators, getSubprocess, getSubprocesses, isEnabled, lookupOperator, notifyRenaming, performAdditionalChecks, processFinished, processStarts, propagateDirtyness, registerOperator, removeOperator, removeSubprocess, shouldAddNonConsumedInput, shouldReturnInnerOutput, unregisterOperator, updateExecutionOrder, walk
 
Methods inherited from class com.rapidminer.operator.Operator
acceptsInput, addError, addError, addValue, addWarning, apply, apply, checkAll, checkAllExcludingMetaData, checkForStop, clearErrorList, createExperimentTree, createExperimentTree, createFromXML, createFromXML, createFromXML, createMarkedExperimentTree, createMarkedProcessTree, createProcessTree, disconnectPorts, execute, fireUpdate, 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, getParameterTypes, getParent, getPortOwner, getProcess, getResourceConsumptionEstimator, getRoot, getStartTime, getTransformer, getUserDescription, getValue, getValues, getXML, getXML, getXML, hasBreakpoint, hasBreakpoint, hasInput, inApplyLoop, isDebugMode, isDirty, isExpanded, isParallel, isParameterSet, isRunning, log, log, logError, logNote, logWarning, makeDirty, makeDirtyOnUpdate, preAutoWire, producesOutput, register, remove, removeAndKeepConnections, rename, resume, setBreakpoint, setCompatibilityLevel, setEnabled, setEnclosingProcess, setExpanded, setInput, setListParameter, setPairParameter, setParameter, setParameters, setUserDescription, shouldAutoConnect, shouldStopStandaloneExecution, toString, transformMetaData, 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, learn
 
Methods inherited from interface com.rapidminer.operator.learner.CapabilityProvider
supportsCapability
 

Field Detail

exampleSetInput

protected final InputPort exampleSetInput

innerModelSink

protected final InputPort innerModelSink
Constructor Detail

AbstractMetaLearner

public AbstractMetaLearner(OperatorDescription description)
Method Detail

modifyGeneratedModelMetaData

protected MetaData modifyGeneratedModelMetaData(PredictionModelMetaData unmodifiedMetaData)
Modifies the meta data of the generated model.


modifyExampleSetMetaData

protected MetaData modifyExampleSetMetaData(ExampleSetMetaData unmodifiedMetaData)
This method can be used by subclasses to additionally change the example set meta data delivered to the inner learner


getTrainingSetInputPort

public InputPort getTrainingSetInputPort()

getModelOutputPort

public OutputPort getModelOutputPort()

getInnerModelSink

public InputPort getInnerModelSink()

doWork

public void doWork()
            throws OperatorException
Trains a model using an ExampleSet from the input. Uses the method learn(ExampleSet).

Overrides:
doWork in class OperatorChain
Throws:
OperatorException

applyInnerLearner

protected Model applyInnerLearner(ExampleSet exampleSet)
                           throws OperatorException
This is a convenience method to apply the inner operators and return the model which must be output of the last operator.

Throws:
OperatorException

executeInnerLearner

protected void executeInnerLearner()
                            throws OperatorException
Throws:
OperatorException

shouldAutoConnect

public boolean shouldAutoConnect(OutputPort port)
Description copied from class: Operator
By default, all ports will be auto-connected by ExecutionUnit.autoWire(CompatibilityLevel, boolean, boolean). Optional outputs were handled up to version 4.4 by parameters. From 5.0 on, optional outputs are computed iff the corresponding port is connected. For backward compatibility, operators can check if we should auto-connect a port by overriding this method (e.g. by checking a deprecated parameter). TODO: Remove in later versions

Overrides:
shouldAutoConnect in class Operator

shouldEstimatePerformance

public boolean shouldEstimatePerformance()
Returns true if the user wants to estimate the performance (depending on a parameter). In this case the method getEstimatedPerformance() must also be overridden and deliver the estimated performance. The default implementation returns false.

Specified by:
shouldEstimatePerformance in interface Learner

shouldCalculateWeights

public boolean shouldCalculateWeights()
Returns true if the user wants to calculate feature weights (depending on a parameter). In this case the method getWeights() must also be overriden and deliver the calculated weights. The default implementation returns false.

Specified by:
shouldCalculateWeights in interface Learner

getEstimatedPerformance

public PerformanceVector getEstimatedPerformance()
                                          throws OperatorException
The default implementation throws an exception.

Specified by:
getEstimatedPerformance in interface Learner
Throws:
OperatorException

getWeights

public AttributeWeights getWeights(ExampleSet exampleSet)
                            throws OperatorException
Returns the calculated weight vectors. The default implementation throws an exception.

Specified by:
getWeights in interface Learner
Throws:
OperatorException


Copyright © 2001-2009 by Rapid-I