com.rapidminer.operator.learner.meta
Class AbstractMetaLearner

java.lang.Object
  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, Learner, ParameterHandler, LoggingHandler
Direct Known Subclasses:
AbstractStacking, AdaBoost, AdditiveRegression, Bagging, BayBoostStream, BayesianBoosting, Binary2MultiClassLearner, ClassificationByRegression, CostBasedThresholdLearner, MetaCost, MultiwayDecisionTree, RelativeRegression, RelevanceTreeLearner, 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 shoud 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 Exp $

Constructor Summary
AbstractMetaLearner(OperatorDescription description)
           
 
Method Summary
 IOObject[] apply()
          Trains a model using an ExampleSet from the input.
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.
 PerformanceVector getEstimatedPerformance()
          The default implementation throws an exception.
 InnerOperatorCondition getInnerOperatorCondition()
          Must return a condition of the IO behaviour of all desired inner operators.
 java.lang.Class<?>[] getInputClasses()
          Returns an array with one element: ExampleSet.
 InputDescription getInputDescription(java.lang.Class cls)
          Indicates that the consumption of example sets can be user defined.
 int getMaxNumberOfInnerOperators()
          Returns the maximum number of inner operators.
 int getMinNumberOfInnerOperators()
          Returns the minimum number of inner operators.
 java.lang.Class<?>[] getOutputClasses()
          Depending on the the learner capabilities (performance estimation, attribute weight calculation) the output classes are generated.
 AttributeWeights getWeights(ExampleSet exampleSet)
          Returns the calculated weight vectors.
 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).
 boolean supportsCapability(LearnerCapability capability)
          For all meta learners, it checks for the underlying operator to see which capabilities are supported by them.
 
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, getParameterTypes, 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, learn
 

Constructor Detail

AbstractMetaLearner

public AbstractMetaLearner(OperatorDescription description)
Method Detail

apply

public IOObject[] apply()
                 throws OperatorException
Trains a model using an ExampleSet from the input. Uses the method Learner.learn(ExampleSet).

Overrides:
apply in class OperatorChain
Returns:
the last inner operator's output or the input itself if the chain is empty.
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

getMinNumberOfInnerOperators

public int getMinNumberOfInnerOperators()
Description copied from class: OperatorChain
Returns the minimum number of inner operators.

Specified by:
getMinNumberOfInnerOperators in class OperatorChain

getMaxNumberOfInnerOperators

public int getMaxNumberOfInnerOperators()
Description copied from class: OperatorChain
Returns the maximum number of inner operators.

Specified by:
getMaxNumberOfInnerOperators in class OperatorChain

getInnerOperatorCondition

public InnerOperatorCondition getInnerOperatorCondition()
Description copied from class: OperatorChain
Must return a condition of the IO behaviour of all desired inner operators. If there are no "special" conditions and the chain works similar to a simple operator chain this method should at least return a SimpleChainInnerOperatorCondition. More than one condition should be combined with help of the class CombinedInnerOperatorCondition.

Specified by:
getInnerOperatorCondition in class OperatorChain

getInputDescription

public InputDescription getInputDescription(java.lang.Class cls)
Indicates that the consumption of example sets can be user defined.

Overrides:
getInputDescription in class Operator

getInputClasses

public java.lang.Class<?>[] getInputClasses()
Returns an array with one element: ExampleSet.

Specified by:
getInputClasses 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 overriden 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

supportsCapability

public boolean supportsCapability(LearnerCapability capability)
For all meta learners, it checks for the underlying operator to see which capabilities are supported by them.

Specified by:
supportsCapability in interface Learner

getOutputClasses

public java.lang.Class<?>[] getOutputClasses()
Depending on the the learner capabilities (performance estimation, attribute weight calculation) the output classes are generated.

Specified by:
getOutputClasses in class Operator


Copyright © 2001-2009 by Rapid-I