org.knime.base.node.preproc.discretization.caim2
Class DiscretizationScheme

java.lang.Object
  extended by org.knime.base.node.preproc.discretization.caim2.DiscretizationScheme

public class DiscretizationScheme
extends Object

Represents a discretization scheme. Therefore, an ordered set of boundaries is hold.

Author:
Christoph Sieb, University of Konstanz

Constructor Summary
DiscretizationScheme(Config content)
          Creates a DiscretizationScheme from a Config object.
DiscretizationScheme(DiscretizationScheme dScheme)
          Creates a discretization scheme from a given one.
DiscretizationScheme(Interval initialInterval)
          Creates a discretization scheme from an initial interval.
 
Method Summary
 double[] getBounds()
          Returns the bounds of the intervals.
 String getDiscreteValue(double value)
          Determins the interval of the value and returns a discrete value for that.
 int getIntervalIndexOf(double value)
          Returns the index of the interval the given value is contained in.
 int getNumIntervals()
           
 void insertBound(double newBound)
          Inserts a new bound into an interval.
 void saveToModelContent(Config modelContent)
          Saves this scheme to a ModelContentWO object.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DiscretizationScheme

public DiscretizationScheme(Interval initialInterval)
Creates a discretization scheme from an initial interval.

Parameters:
initialInterval - the initial interval

DiscretizationScheme

public DiscretizationScheme(DiscretizationScheme dScheme)
Creates a discretization scheme from a given one. Creates a deep copy except the intervals which are imutable.

Parameters:
dScheme - the discretization scheme to copy

DiscretizationScheme

public DiscretizationScheme(Config content)
                     throws InvalidSettingsException
Creates a DiscretizationScheme from a Config object.

Parameters:
content - the content object to restore the model from
Throws:
InvalidSettingsException - thrown if the settings are invalid
Method Detail

getIntervalIndexOf

public int getIntervalIndexOf(double value)
Returns the index of the interval the given value is contained in.

Parameters:
value - the value to find the interval index for
Returns:
the index of the interval the value is contained in; -1 if not contained in any interval

getDiscreteValue

public String getDiscreteValue(double value)
Determins the interval of the value and returns a discrete value for that.

Parameters:
value - the value to discretize
Returns:
the discretized value

insertBound

public void insertBound(double newBound)
Inserts a new bound into an interval. This results in one additional interval. The new bound must be located within an interval.

Parameters:
newBound - the new bound to insert

getNumIntervals

public int getNumIntervals()
Returns:
the number of intervals of this discretization scheme

toString

public String toString()

Overrides:
toString in class Object

saveToModelContent

public void saveToModelContent(Config modelContent)
Saves this scheme to a ModelContentWO object.

Parameters:
modelContent - the Config object to store the DiscretizationScheme to

getBounds

public double[] getBounds()
Returns the bounds of the intervals. It is assumed that the bounderies are touching each other.

Returns:
the boundary values


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.