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

java.lang.Object
  extended by org.knime.base.node.mine.bfn.BasisFunctionPredictorRow
Direct Known Subclasses:
FuzzyBasisFunctionPredictorRow, RadialBasisFunctionPredictorRow

public abstract class BasisFunctionPredictorRow
extends Object

Class presents a predictor row for basisfunctions providing method to apply unknown data (compose).

Author:
Thomas Gabriel, University of Konstanz

Constructor Summary
  BasisFunctionPredictorRow(ModelContentRO pp)
          Creates new predictor row on model content.
protected BasisFunctionPredictorRow(RowKey key, DataCell classLabel, double dontKnowDegree)
          Creates new predictor row.
 
Method Summary
abstract  double compose(DataRow row, double act)
          Composes the activation of the given array and of the calculated one based on the given row.
abstract  double computeActivation(DataRow row)
          Computes the activation based on the given row for this basisfunction.
abstract  double computeDistance(DataRow row)
           
abstract  double computeSpread()
          Returns a value for the spread of this rule.
(package private)  void cover(DataRow row, DataCell classLabel)
          If the same class as this basisfunction is assigned to, the number of correctly covered pattern is increased, otherwise the number of wrong covered ones.
 DataCell getClassLabel()
           
 double getDontKnowClassDegree()
           
 RowKey getId()
           
abstract  int getNrUsedFeatures()
           
 int getNumAllCoveredPattern()
          Returns the number of covered input pattern.
 int getNumCorrectCoveredPattern()
          Returns the number of correctly covered data pattern.
 int getNumWrongCoveredPattern()
          Returns the number of wrong covered data pattern.
 double getVariance()
           
abstract  double overlap(BasisFunctionPredictorRow bf, boolean symmetric)
          Computes the overlapping of two basis functions.
static double overlapping(double minA, double maxA, double minB, double maxB, boolean symmetric)
          Computes the overlapping based on two lines.
(package private)  void resetCoveredPattern()
          Resets all covered pattern.
 void save(ModelContentWO pp)
          Saves this row into a model content.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasisFunctionPredictorRow

protected BasisFunctionPredictorRow(RowKey key,
                                    DataCell classLabel,
                                    double dontKnowDegree)
Creates new predictor row.

Parameters:
key - the key of this row
classLabel - class label of the target attribute
dontKnowDegree - don't know probability

BasisFunctionPredictorRow

public BasisFunctionPredictorRow(ModelContentRO pp)
                          throws InvalidSettingsException
Creates new predictor row on model content.

Parameters:
pp - the model content to read the new predictor row from
Throws:
InvalidSettingsException - if the model content is invalid
Method Detail

computeDistance

public abstract double computeDistance(DataRow row)
Parameters:
row - to compute distance with
Returns:
computes the distance between this row and the anchor

computeSpread

public abstract double computeSpread()
Returns a value for the spread of this rule.

Returns:
rule spread value

overlap

public abstract double overlap(BasisFunctionPredictorRow bf,
                               boolean symmetric)
Computes the overlapping of two basis functions.

Parameters:
symmetric - if the result is proportional to both basis functions, and thus symmetric, or if it is proportional to the area of the basisfunction on which the function is called.
bf - the other basisfunction to compute overlapping with
Returns:
true, if both are overlapping

overlapping

public static final double overlapping(double minA,
                                       double maxA,
                                       double minB,
                                       double maxB,
                                       boolean symmetric)
Computes the overlapping based on two lines.

Parameters:
minA - left point line A
maxA - right point line A
minB - left point line B
maxB - right point line B
symmetric - if the result is proportional to both basis functions, and thus symmetric, or if it is proportional to the area of the basis function on which the function is called
Returns:
the positive overlapping spread of this two lines or zero if none

cover

final void cover(DataRow row,
                 DataCell classLabel)
If the same class as this basisfunction is assigned to, the number of correctly covered pattern is increased, otherwise the number of wrong covered ones.

Parameters:
row - to cover
classLabel - a pattern of the given class has to be covered

getVariance

public final double getVariance()
Returns:
with-in cluster variance

computeActivation

public abstract double computeActivation(DataRow row)
Computes the activation based on the given row for this basisfunction.

Parameters:
row - compute activation for
Returns:
activation between 0 and 1

compose

public abstract double compose(DataRow row,
                               double act)
Composes the activation of the given array and of the calculated one based on the given row. All values itself have to be between 0 and 1.

Parameters:
row - combine activation with this pattern
act - activation to combine with
Returns:
the new activation compromising the given activation

getNrUsedFeatures

public abstract int getNrUsedFeatures()
Returns:
number of features that have been shrunken

getDontKnowClassDegree

public final double getDontKnowClassDegree()
Returns:
don't know class probability

getClassLabel

public final DataCell getClassLabel()
Returns:
class label

getNumAllCoveredPattern

public final int getNumAllCoveredPattern()
Returns the number of covered input pattern.

Returns:
the current number of covered input pattern

getNumCorrectCoveredPattern

public final int getNumCorrectCoveredPattern()
Returns the number of correctly covered data pattern.

Returns:
the current number of covered input pattern

getNumWrongCoveredPattern

public final int getNumWrongCoveredPattern()
Returns the number of wrong covered data pattern.

Returns:
the current number of covered input pattern

resetCoveredPattern

final void resetCoveredPattern()
Resets all covered pattern. Called by the learner only.


getId

public final RowKey getId()
Returns:
row key for this row

save

public void save(ModelContentWO pp)
Saves this row into a model content.

Parameters:
pp - the model content to save this row to

toString

public String toString()

Overrides:
toString in class Object


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.