org.knime.base.node.mine.bfn
Class BasisFunctionFactory

java.lang.Object
  extended by org.knime.base.node.mine.bfn.BasisFunctionFactory
Direct Known Subclasses:
FuzzyBasisFunctionFactory, RadialBasisFunctionFactory

public abstract class BasisFunctionFactory
extends Object

Factory class for BasisFunctionLearnerRow which automatically creates new basis functions of a certain type.

Author:
Thomas Gabriel, University of Konstanz
See Also:
BasisFunctionLearnerRow

Field Summary
(package private) static String CFG_DISTANCE
          Key for the distance function.
(package private) static String CFG_MODEL_SPEC
          Key for the model spec.
static DataColumnSpec CLASS_COLUMN
          Name of the basisfunction class column.
 
Constructor Summary
protected BasisFunctionFactory(DataTableSpec spec, String[] targetColumns, DataType type, int distance)
          Creates new basisfunction factory with the given spec to extract min/max value for all numeric columns.
 
Method Summary
abstract  BasisFunctionLearnerRow commit(RowKey key, DataCell classInfo, DataRow row)
          Returns a new row initialised by a DataRow as its initial center vector and a class label.
static DataTableSpec createModelSpec(DataTableSpec inSpec, String[] dataColumns, String[] targetColumns, DataType type)
          Creates a model spec based on the data input spec by extracting all DoubleCell columns and the specified target column.
static String[] findDataColumns(DataTableSpec spec, List<String> targetCols)
          Find all numeric columns which are not target columns.
 int getDistance()
          Returns the choice of distance function.
 MutableDouble[] getMaximums()
           
 MutableDouble[] getMinimums()
           
 DataTableSpec getModelSpec()
           
 void save(ModelContent pp)
          Saves to model content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CFG_DISTANCE

static final String CFG_DISTANCE
Key for the distance function.

See Also:
Constant Field Values

CFG_MODEL_SPEC

static final String CFG_MODEL_SPEC
Key for the model spec.

See Also:
Constant Field Values

CLASS_COLUMN

public static final DataColumnSpec CLASS_COLUMN
Name of the basisfunction class column.

Constructor Detail

BasisFunctionFactory

protected BasisFunctionFactory(DataTableSpec spec,
                               String[] targetColumns,
                               DataType type,
                               int distance)
Creates new basisfunction factory with the given spec to extract min/max value for all numeric columns.

Parameters:
spec - the training's data spec
targetColumns - the class info column in the data
type - the type for the model columns
distance - the choice of distance function
Method Detail

findDataColumns

public static final String[] findDataColumns(DataTableSpec spec,
                                             List<String> targetCols)
Find all numeric columns which are not target columns.

Parameters:
spec - the input spec
targetCols - column(s) set as target
Returns:
array of data column names

getMinimums

public final MutableDouble[] getMinimums()
Returns:
the lower bounds.

getMaximums

public final MutableDouble[] getMaximums()
Returns:
the upper bounds.

createModelSpec

public static final DataTableSpec createModelSpec(DataTableSpec inSpec,
                                                  String[] dataColumns,
                                                  String[] targetColumns,
                                                  DataType type)
Creates a model spec based on the data input spec by extracting all DoubleCell columns and the specified target column.

Parameters:
inSpec - the input data spec
dataColumns - the data columns used for training
targetColumns - the target classification columns
type - the type for the model columns
Returns:
a new table spec with a number of DoubleCells and the target column last

getDistance

public final int getDistance()
Returns the choice of distance function.

Returns:
distance function

getModelSpec

public DataTableSpec getModelSpec()
Returns:
the model's spec with class info column

commit

public abstract BasisFunctionLearnerRow commit(RowKey key,
                                               DataCell classInfo,
                                               DataRow row)
Returns a new row initialised by a DataRow as its initial center vector and a class label.

Parameters:
key - this row's key
classInfo - data cell contains class info
row - the initial center vector
Returns:
a new row of a certain type

save

public void save(ModelContent pp)
Saves to model content.

Parameters:
pp - the model content this is saved to.


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.