org.knime.base.node.preproc.sample
Class SamplingNodeSettings

java.lang.Object
  extended by org.knime.base.node.preproc.sample.SamplingNodeSettings

public class SamplingNodeSettings
extends Object

This class holds the settings for the sampling and the partioning node.

Author:
Thorsten Meinl, University of Konstanz

Nested Class Summary
static class SamplingNodeSettings.CountMethods
          Enum for the two methods for setting the number of rows in the output table.
static class SamplingNodeSettings.SamplingMethods
          Enum for the four different sampling methods.
 
Constructor Summary
SamplingNodeSettings()
           
 
Method Summary
 String classColumn()
          Returns the class column whose distribution should be retained when using stratified sampling.
 void classColumn(String columnName)
          Sets the class column whose distribution should be retained when using stratified sampling.
 int count()
          Returns the absolute number of rows in the output table.
 void count(int count)
          Sets the absolute number of rows in the output table.
 SamplingNodeSettings.CountMethods countMethod()
          Returns the method use for sampling the rows.
 void countMethod(SamplingNodeSettings.CountMethods method)
          Sets the method use for sampling the rows.
 double fraction()
          Returns the relative number of rows in the output table (in relation to the number of input rows).
 void fraction(double fraction)
          Sets the relative number of rows in the output table (in relation to the number of input rows).
 void loadSettingsFrom(NodeSettingsRO settings, boolean guessValues)
          Loads the setting from the given object.
 SamplingNodeSettings.SamplingMethods samplingMethod()
          Returns the sampling method.
 void samplingMethod(SamplingNodeSettings.SamplingMethods method)
          Sets the sampling method.
 void saveSettingsTo(NodeSettingsWO settings)
          Saves the settings to the given object.
 Long seed()
          Returns the optional random seed.
 void seed(Long seed)
          Sets the seed for the random number generator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SamplingNodeSettings

public SamplingNodeSettings()
Method Detail

saveSettingsTo

public void saveSettingsTo(NodeSettingsWO settings)
Saves the settings to the given object.

Parameters:
settings - the node settings object

loadSettingsFrom

public void loadSettingsFrom(NodeSettingsRO settings,
                             boolean guessValues)
                      throws InvalidSettingsException
Loads the setting from the given object.

Parameters:
settings - the settings
guessValues - If true, default values are used in case the settings are incomplete, false will throw an exception. true should be used when called from the dialog, false when called from the model.
Throws:
InvalidSettingsException - if settings incomplete and guessValues is false

count

public int count()
Returns the absolute number of rows in the output table.

Returns:
the absolute number of rows

count

public void count(int count)
Sets the absolute number of rows in the output table.

Parameters:
count - the number of rows

fraction

public double fraction()
Returns the relative number of rows in the output table (in relation to the number of input rows).

Returns:
the relative number of rows (a value between 0 and 1)

fraction

public void fraction(double fraction)
Sets the relative number of rows in the output table (in relation to the number of input rows).

Parameters:
fraction - the relative number of rows, a value between 0 and 1

countMethod

public SamplingNodeSettings.CountMethods countMethod()
Returns the method use for sampling the rows.

Returns:
the sampling method

countMethod

public void countMethod(SamplingNodeSettings.CountMethods method)
Sets the method use for sampling the rows.

Parameters:
method - the sampling method

samplingMethod

public SamplingNodeSettings.SamplingMethods samplingMethod()
Returns the sampling method.

Returns:
the sampling method

samplingMethod

public void samplingMethod(SamplingNodeSettings.SamplingMethods method)
Sets the sampling method.

Parameters:
method - the sampling method

seed

public Long seed()
Returns the optional random seed.

Returns:
the random seed or null if none is specified

seed

public void seed(Long seed)
Sets the seed for the random number generator.

Parameters:
seed - a seed or null if none is set

classColumn

public void classColumn(String columnName)
Sets the class column whose distribution should be retained when using stratified sampling.

Parameters:
columnName - the name of the class column

classColumn

public String classColumn()
Returns the class column whose distribution should be retained when using stratified sampling.

Returns:
the name of the class column


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.