com.rapidminer.operator
Class AbstractModel

java.lang.Object
  extended by com.rapidminer.operator.AbstractIOObject
      extended by com.rapidminer.operator.ResultObjectAdapter
          extended by com.rapidminer.operator.AbstractModel
All Implemented Interfaces:
IOObject, Model, ResultObject, Saveable, Readable, Reportable, LoggingHandler, java.io.Serializable
Direct Known Subclasses:
DimensionalityReducerModel, FastICAModel, GHAModel, GroupedModel, KernelPCAModel, PCAModel, PredictionModel, PreprocessingModel, SOMDimensionalityReductionModel, VectorRegressionModel, WekaClusterModel

public abstract class AbstractModel
extends ResultObjectAdapter
implements Model

Abstract model is the superclass for all objects which change a data set. For example, a model generated by a learner might add a predicted attribute. Other models can be created during preprocessing, e.g. a transformation model containing the parameters for a z-transformation. Models can be combined by using a CombinedModel. All models can be applied with a ModelApplier operator.

Author:
Ingo Mierswa
See Also:
Serialized Form

Constructor Summary
protected AbstractModel(ExampleSet exampleSet)
          Created a new model which was built on the given example set.
 
Method Summary
 java.lang.String getExtension()
          Returns the default extension in file choosers.
 java.lang.String getFileDescription()
          Returns the file description used in file choosers.
 java.lang.String getName()
          The default implementation returns the result of the super class.
 javax.swing.Icon getResultIcon()
          Returns null.
protected  HeaderExampleSet getTrainingHeader()
          Delivers the training header example set, i.e. the header of the example set (without data reference) which was used for creating this model.
 boolean isUpdatable()
          This default implementation returns false.
 void setParameter(java.lang.String key, java.lang.Object value)
          Throws a UserError since most models should not allow additional parameters during application.
 void updateModel(ExampleSet updateExampleSet)
          This default implementation throws an UserError.
 
Methods inherited from class com.rapidminer.operator.ResultObjectAdapter
addAction, getActions, getVisualizationComponent, isSavable, log, logError, logNote, logWarning, save, toHTML, toResultString
 
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, toString, wait, wait, wait
 
Methods inherited from interface com.rapidminer.operator.Model
apply
 
Methods inherited from interface com.rapidminer.operator.ResultObject
getActions, getVisualizationComponent, toResultString
 
Methods inherited from interface com.rapidminer.operator.IOObject
copy, getLog, getSource, setLoggingHandler, setSource, write
 
Methods inherited from interface com.rapidminer.operator.Saveable
isSavable, save
 
Methods inherited from interface com.rapidminer.report.Readable
toString
 

Constructor Detail

AbstractModel

protected AbstractModel(ExampleSet exampleSet)
Created a new model which was built on the given example set. Please note that the given example set is automatically transformed into a HeaderExampleSet which means that no reference to the data itself is kept but only to the header, i.e. to the attribute meta descriptions.

Method Detail

getTrainingHeader

protected HeaderExampleSet getTrainingHeader()
Delivers the training header example set, i.e. the header of the example set (without data reference) which was used for creating this model. Might return null.


isUpdatable

public boolean isUpdatable()
This default implementation returns false. Note that subclasses overriding this method should also override the method updateModel(ExampleSet).

Specified by:
isUpdatable in interface Model

updateModel

public void updateModel(ExampleSet updateExampleSet)
                 throws OperatorException
This default implementation throws an UserError. Subclasses overriding this method to update the model according to the given example set should also override the method isUpdatable() by delivering true.

Specified by:
updateModel in interface Model
Throws:
OperatorException

setParameter

public void setParameter(java.lang.String key,
                         java.lang.Object value)
                  throws OperatorException
Throws a UserError since most models should not allow additional parameters during application. However, subclasses may overwrite this method.

Specified by:
setParameter in interface Model
Throws:
OperatorException

getName

public java.lang.String getName()
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 ResultObjectAdapter

getExtension

public java.lang.String getExtension()
Description copied from interface: Saveable
Returns the default extension in file choosers.

Specified by:
getExtension in interface Saveable

getFileDescription

public java.lang.String getFileDescription()
Description copied from interface: Saveable
Returns the file description used in file choosers.

Specified by:
getFileDescription in interface Saveable

getResultIcon

public javax.swing.Icon getResultIcon()
Description copied from class: ResultObjectAdapter
Returns null. Subclasses might want to override this method and returns an appropriate icon.

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


Copyright © 2001-2009 by Rapid-I