com.rapidminer.operator
Class GroupedModel

java.lang.Object
  extended by com.rapidminer.operator.AbstractIOObject
      extended by com.rapidminer.operator.ResultObjectAdapter
          extended by com.rapidminer.operator.AbstractModel
              extended by com.rapidminer.operator.GroupedModel
All Implemented Interfaces:
IOObject, Model, ResultObject, Saveable, Readable, Reportable, LoggingHandler, java.io.Serializable, java.lang.Iterable<Model>

public class GroupedModel
extends AbstractModel
implements java.lang.Iterable<Model>

This model is a container for all models which should be applied in a sequence.

Author:
Ingo Mierswa
See Also:
Serialized Form

Constructor Summary
GroupedModel()
           
 
Method Summary
 void addModel(Model model)
          Adds the given model to the container.
 ExampleSet apply(ExampleSet exampleSet)
          Applies all models.
<T extends Model>
T
getModel(java.lang.Class<T> desiredClass)
          Returns the first model in this container with the desired class.
 Model getModel(int index)
          Returns the i-th model.
 java.lang.String getName()
          The default implementation returns the result of the super class.
 int getNumberOfModels()
          Returns the total number of models.
 java.awt.Component getVisualizationComponent(IOContainer container)
          Returns a visualization component with a model selector.
 boolean isUpdatable()
          Returns true if all inner models return true.
 java.util.Iterator<Model> iterator()
           
 void prependModel(Model model)
          Adds the given model to the container.
 void removeModel(Model model)
          Removes the given model from the container.
 void setParameter(java.lang.String key, java.lang.Object value)
          Invokes the method for all models.
 java.lang.String toResultString()
          The default implementation simply returns the result of the method Object.toString().
 java.lang.String toString()
           
 void updateModel(ExampleSet updateExampleSet)
          Updates the model if the classifier is updatable.
 
Methods inherited from class com.rapidminer.operator.AbstractModel
getExtension, getFileDescription, getResultIcon, getTrainingHeader
 
Methods inherited from class com.rapidminer.operator.ResultObjectAdapter
addAction, getActions, isSavable, log, logError, logNote, logWarning, save, toHTML
 
Methods inherited from class com.rapidminer.operator.AbstractIOObject
copy, getLog, getSource, initWriting, read, setLoggingHandler, setSource, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.rapidminer.operator.ResultObject
getActions
 
Methods inherited from interface com.rapidminer.operator.IOObject
copy, getLog, getSource, setLoggingHandler, setSource, write
 
Methods inherited from interface com.rapidminer.operator.Saveable
isSavable, save
 

Constructor Detail

GroupedModel

public GroupedModel()
Method Detail

apply

public ExampleSet apply(ExampleSet exampleSet)
                 throws OperatorException
Applies all models.

Specified by:
apply in interface Model
Throws:
OperatorException

iterator

public java.util.Iterator<Model> iterator()
Specified by:
iterator in interface java.lang.Iterable<Model>

isUpdatable

public boolean isUpdatable()
Returns true if all inner models return true.

Specified by:
isUpdatable in interface Model
Overrides:
isUpdatable in class AbstractModel

updateModel

public void updateModel(ExampleSet updateExampleSet)
                 throws OperatorException
Updates the model if the classifier is updatable. Otherwise, an UserError is thrown.

Specified by:
updateModel in interface Model
Overrides:
updateModel in class AbstractModel
Throws:
OperatorException

getName

public java.lang.String getName()
Description copied from class: AbstractModel
The default implementation returns the result of the super class. If the string ends with model, the substring "model" is removed.

Specified by:
getName in interface ResultObject
Overrides:
getName in class AbstractModel

prependModel

public void prependModel(Model model)
Adds the given model to the container.


addModel

public void addModel(Model model)
Adds the given model to the container.


removeModel

public void removeModel(Model model)
Removes the given model from the container.


getNumberOfModels

public int getNumberOfModels()
Returns the total number of models.


getModel

public Model getModel(int index)
Returns the i-th model.


getModel

public <T extends Model> T getModel(java.lang.Class<T> desiredClass)
Returns the first model in this container with the desired class. A cast is not necessary.


setParameter

public void setParameter(java.lang.String key,
                         java.lang.Object value)
                  throws OperatorException
Invokes the method for all models. Please note that this method will only throw an exception if no model was able to handle the given parameter.

Specified by:
setParameter in interface Model
Overrides:
setParameter in class AbstractModel
Throws:
OperatorException

toString

public java.lang.String toString()
Specified by:
toString in interface Readable
Overrides:
toString in class java.lang.Object

toResultString

public java.lang.String toResultString()
Description copied from class: ResultObjectAdapter
The default implementation simply returns the result of the method Object.toString().

Specified by:
toResultString in interface ResultObject
Overrides:
toResultString in class ResultObjectAdapter

getVisualizationComponent

public java.awt.Component getVisualizationComponent(IOContainer container)
Returns a visualization component with a model selector.

Specified by:
getVisualizationComponent in interface ResultObject
Overrides:
getVisualizationComponent in class ResultObjectAdapter


Copyright © 2001-2009 by Rapid-I