org.knime.base.node.mine.knn
Class KnnSettings

java.lang.Object
  extended by org.knime.base.node.mine.knn.KnnSettings

public class KnnSettings
extends Object

This class stores the settings for the kNN node.

Author:
Thorsten Meinl, University of Konstanz

Constructor Summary
KnnSettings()
           
 
Method Summary
 String classColumn()
          Returns the name of the column with the class labels.
 void classColumn(String classColumn)
          sets the name of the column with the class labels.
 int k()
          Returns the number of neighbours to consider.
 void k(int k)
          Sets the number of neighbours to consider.
 void loadSettings(NodeSettingsRO settings)
          Loads the settings from the given node settings object.
 void saveSettings(NodeSettingsWO settings)
          Saves the settings into the given node settings object.
 boolean weightByDistance()
          Returns if the nearest neighbours should be weighted by their distance to the query pattern.
 void weightByDistance(boolean b)
          Sets if the nearest neighbours should be weighted by their distance to the query pattern.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KnnSettings

public KnnSettings()
Method Detail

weightByDistance

public boolean weightByDistance()
Returns if the nearest neighbours should be weighted by their distance to the query pattern.

Returns:
true if the neighbours should be weighted by their distance, false otherwise

weightByDistance

public void weightByDistance(boolean b)
Sets if the nearest neighbours should be weighted by their distance to the query pattern.

Parameters:
b - true if the neighbours should be weighted by their distance, false otherwise

k

public int k()
Returns the number of neighbours to consider.

Returns:
the number of neighbours

k

public void k(int k)
Sets the number of neighbours to consider.

Parameters:
k - the number of neighbours

classColumn

public String classColumn()
Returns the name of the column with the class labels.

Returns:
the class column's name

classColumn

public void classColumn(String classColumn)
sets the name of the column with the class labels.

Parameters:
classColumn - the class column's name

saveSettings

public void saveSettings(NodeSettingsWO settings)
Saves the settings into the given node settings object.

Parameters:
settings - a node settings object

loadSettings

public void loadSettings(NodeSettingsRO settings)
                  throws InvalidSettingsException
Loads the settings from the given node settings object.

Parameters:
settings - a node settings object
Throws:
InvalidSettingsException - if some settings are missing or invalid


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.