org.knime.base.node.mine.bfn.fuzzy
Class FuzzyBasisFunctionLearnerRow

java.lang.Object
  extended by org.knime.base.node.mine.bfn.BasisFunctionLearnerRow
      extended by org.knime.base.node.mine.bfn.fuzzy.FuzzyBasisFunctionLearnerRow
All Implemented Interfaces:
Iterable<DataCell>, DataRow

public class FuzzyBasisFunctionLearnerRow
extends BasisFunctionLearnerRow

Extends the general BasisFunctionLearnerRow object to act as rectangular fuzzy prototype. Each feature value holds a fuzzy membership function (trapezoid membership function so far) with a assigned anchor retrieved from the input row which commit this rule.

Author:
Thomas Gabriel, University of Konstanz

Constructor Summary
protected FuzzyBasisFunctionLearnerRow(RowKey key, DataCell classInfo, DataRow centroid, int norm, int shrink, MutableDouble[] min, MutableDouble[] max)
          Creates a new learner row for fuzzy rules.
 
Method Summary
 boolean compareCoverage(BasisFunctionLearnerRow o, DataRow r)
          Compares this basisfunction with the another one by the fuzzy rule's number of covered pattern.
 double computeActivation(DataRow row)
          Computes activation for a given row using this basis function.
 double computeSpread()
          Returns the aggregated spread of the core.
 void cover(DataRow row)
          This basis function covers the given row.
 boolean covers(DataRow row)
          Returns true if the given row is covered by this prototype, that is, if computeActivation(DataRow) returns a degree greater than MINACT.
 boolean explains(DataRow row)
          Returns true if the given row is covered by this prototype, that is, if computeActivation(DataRow) returns a degree equal 1.
 DataCell getFinalCell(int index)
          Returns a basis function cell for the given index.
 DoubleValue getMissingValue(int col)
           
 FuzzyBasisFunctionPredictorRow getPredictorRow()
          
 int getShrink()
           
 boolean getShrinkValue(DataRow row)
          Called if a new BasisFunctionLearnerRow has to be adjusted.
 void reset()
          Resets core value of all dimensions to the initial anchor value.
 boolean shrink(DataRow row)
          If a new prototype has to be adjusted.
 String toString()
          Returns a string representation of this basis function.
 String toStringARFF()
          Returns a ARFF string-like summary of this fuzzy bf.
 
Methods inherited from class org.knime.base.node.mine.bfn.BasisFunctionLearnerRow
addCovered, computeCoverage, equals, getAllCoveredPattern, getAnchor, getCell, getClassLabel, getKey, getNumCells, getVariance, hashCode, iterator, print
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FuzzyBasisFunctionLearnerRow

protected FuzzyBasisFunctionLearnerRow(RowKey key,
                                       DataCell classInfo,
                                       DataRow centroid,
                                       int norm,
                                       int shrink,
                                       MutableDouble[] min,
                                       MutableDouble[] max)
Creates a new learner row for fuzzy rules.

Parameters:
key - the key for the row.
classInfo - the class label.
centroid - the initial center row which forms the anchor of this fuzzy rule.
norm - A fuzzy norm function.
shrink - A function to shrink rules.
min - An array if minimum bounds, for each input dimension.
max - An array if maximum bounds, for each input dimension.
Method Detail

getPredictorRow

public FuzzyBasisFunctionPredictorRow getPredictorRow()

Specified by:
getPredictorRow in class BasisFunctionLearnerRow
Returns:
underlying predictor row

getMissingValue

public DoubleValue getMissingValue(int col)
Specified by:
getMissingValue in class BasisFunctionLearnerRow
Parameters:
col - the column index
Returns:
the center of gravity in this dimension.

covers

public boolean covers(DataRow row)
Returns true if the given row is covered by this prototype, that is, if computeActivation(DataRow) returns a degree greater than MINACT.

Specified by:
covers in class BasisFunctionLearnerRow
Parameters:
row - the data row to check coverage for
Returns:
true if the row is covered
See Also:
computeActivation(DataRow)

explains

public boolean explains(DataRow row)
Returns true if the given row is covered by this prototype, that is, if computeActivation(DataRow) returns a degree equal 1.

Specified by:
explains in class BasisFunctionLearnerRow
Parameters:
row - the data row to check coverage for
Returns:
true if the row is explained
See Also:
computeActivation(DataRow)

getShrinkValue

public final boolean getShrinkValue(DataRow row)
Called if a new BasisFunctionLearnerRow has to be adjusted.

Specified by:
getShrinkValue in class BasisFunctionLearnerRow
Parameters:
row - conflicting pattern
Returns:
a value greater zero if a conflict has to be solved. The value indicates relative loss in coverage for this basis function.

shrink

public final boolean shrink(DataRow row)
If a new prototype has to be adjusted. Goes through all membership function dimensions and looks for this with the smallest loss value. The support shrink has priority for the core region, if no shrink need the function returns false, otherwise true if the shrink was effected.

Specified by:
shrink in class BasisFunctionLearnerRow
Parameters:
row - the input pattern for shrinking
Returns:
true if a dimension was effect by this operation

reset

public void reset()
Resets core value of all dimensions to the initial anchor value.

Specified by:
reset in class BasisFunctionLearnerRow

cover

public void cover(DataRow row)
This basis function covers the given row.

Specified by:
cover in class BasisFunctionLearnerRow
Parameters:
row - the row to cover

compareCoverage

public boolean compareCoverage(BasisFunctionLearnerRow o,
                               DataRow r)
Compares this basisfunction with the another one by the fuzzy rule's number of covered pattern.

Specified by:
compareCoverage in class BasisFunctionLearnerRow
Parameters:
o - the other basisfunction to compare with
r - the row to compute activation on
Returns:
true if the number covered pattern of this object is greater
Throws:
NullPointerException - if one of the args in null

computeSpread

public double computeSpread()
Returns the aggregated spread of the core.

Returns:
the overall spread of the core regions

toString

public String toString()
Returns a string representation of this basis function. Calls the super toString() before adding this fuzzy bfs membership functions.

Overrides:
toString in class BasisFunctionLearnerRow
Returns:
a String summary of this fuzzy bf string summary for this basisfunction cell

toStringARFF

public String toStringARFF()
Returns a ARFF string-like summary of this fuzzy bf.

Returns:
a ARFF-style fuzzy bf representation

getFinalCell

public DataCell getFinalCell(int index)
Returns a basis function cell for the given index.

Specified by:
getFinalCell in class BasisFunctionLearnerRow
Parameters:
index - cell for index
Returns:
a basis function cell

computeActivation

public double computeActivation(DataRow row)
Computes activation for a given row using this basis function.

Specified by:
computeActivation in class BasisFunctionLearnerRow
Parameters:
row - the data row to compute activation with
Returns:
the activation of the row

getShrink

public final int getShrink()
Returns:
shrink method


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.