com.rapidminer.operator.preprocessing.discretization
Class DiscretizationModel

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.preprocessing.PreprocessingModel
                  extended by com.rapidminer.operator.preprocessing.discretization.DiscretizationModel
All Implemented Interfaces:
IOObject, Model, ResultObject, Saveable, ViewModel, Readable, Reportable, LoggingHandler, java.io.Serializable

public class DiscretizationModel
extends PreprocessingModel

The generic discretization model.

Author:
Sebastian Land
See Also:
Serialized Form

Field Summary
static int RANGE_NAME_INTERVAL
           
static int RANGE_NAME_LONG
           
static int RANGE_NAME_SHORT
           
static java.lang.String[] RANGE_NAME_TYPES
           
 
Constructor Summary
DiscretizationModel(ExampleSet exampleSet)
           
DiscretizationModel(ExampleSet exampleSet, boolean removeUseless)
           
 
Method Summary
 ExampleSet applyOnData(ExampleSet exampleSet)
           
 java.util.Map<java.lang.String,java.util.SortedSet<Tupel<java.lang.Double,java.lang.String>>> getRanges()
           
 Attributes getTargetAttributes(ExampleSet parentSet)
          This method has to return a legal Attributes object containing every Attribute, the view should contain
 double getValue(Attribute targetAttribute, double value)
          This method has to provide the attribute value mapping for the view.
 void setRanges(java.util.Map<Attribute,double[]> rangesMap, java.lang.String rangeName, int rangeNameType, int numberOfDigits)
          Creates the ranges.
 void setRanges(java.util.Map<java.lang.String,java.util.SortedSet<Tupel<java.lang.Double,java.lang.String>>> rangesMap)
           
 java.lang.String toString()
           
 
Methods inherited from class com.rapidminer.operator.preprocessing.PreprocessingModel
apply, getResultIcon, setParameter
 
Methods inherited from class com.rapidminer.operator.AbstractModel
getExtension, getFileDescription, getName, getTrainingHeader, isUpdatable, updateModel
 
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, wait, wait, wait
 
Methods inherited from interface com.rapidminer.operator.Model
isUpdatable, updateModel
 
Methods inherited from interface com.rapidminer.operator.ResultObject
getActions, getName, getVisualizationComponent, toResultString
 
Methods inherited from interface com.rapidminer.operator.IOObject
copy, getLog, getSource, setLoggingHandler, setSource, write
 
Methods inherited from interface com.rapidminer.operator.Saveable
getExtension, getFileDescription, isSavable, save
 

Field Detail

RANGE_NAME_TYPES

public static final java.lang.String[] RANGE_NAME_TYPES

RANGE_NAME_LONG

public static final int RANGE_NAME_LONG
See Also:
Constant Field Values

RANGE_NAME_SHORT

public static final int RANGE_NAME_SHORT
See Also:
Constant Field Values

RANGE_NAME_INTERVAL

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

DiscretizationModel

public DiscretizationModel(ExampleSet exampleSet)

DiscretizationModel

public DiscretizationModel(ExampleSet exampleSet,
                           boolean removeUseless)
Method Detail

applyOnData

public ExampleSet applyOnData(ExampleSet exampleSet)
                       throws OperatorException
Specified by:
applyOnData in class PreprocessingModel
Throws:
OperatorException

setRanges

public void setRanges(java.util.Map<Attribute,double[]> rangesMap,
                      java.lang.String rangeName,
                      int rangeNameType,
                      int numberOfDigits)
               throws UserError
Creates the ranges. If the range name type is 'Interval' and the number of digits is smaller than 0, the number of digits is automatically determined in a way such that the range names do actually differ but are rounded as far as possible.

Throws:
UserError

setRanges

public void setRanges(java.util.Map<java.lang.String,java.util.SortedSet<Tupel<java.lang.Double,java.lang.String>>> rangesMap)

getRanges

public java.util.Map<java.lang.String,java.util.SortedSet<Tupel<java.lang.Double,java.lang.String>>> getRanges()

toString

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

getTargetAttributes

public Attributes getTargetAttributes(ExampleSet parentSet)
Description copied from interface: ViewModel
This method has to return a legal Attributes object containing every Attribute, the view should contain

Returns:
The attribute object

getValue

public double getValue(Attribute targetAttribute,
                       double value)
Description copied from interface: ViewModel
This method has to provide the attribute value mapping for the view. The views attributes will ask this method for their value.

Parameters:
targetAttribute - the attribute, which asks for his value
value - the value the source attribute had in original data
Returns:
the value the attribute should have in target view


Copyright © 2001-2009 by Rapid-I