|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.base.node.mine.bfn.BasisFunctionLearnerRow
public abstract class BasisFunctionLearnerRow
General BasisFunctionLearnerRow
prototype which provides
functions to shrink, cover, and reset rules; and to be compared with others
by its coverage. This basis function also keeps a list of all covered
training examples.
Constructor Summary | |
---|---|
protected |
BasisFunctionLearnerRow(RowKey key,
DataRow centroid,
DataCell classInfo)
Initialise a new basisfunction rule with one covered pattern since this rule is also covered by itself. |
Method Summary | |
---|---|
void |
addCovered(DataRow row,
DataCell classInfo)
If a new instance of this class is covered. |
abstract boolean |
compareCoverage(BasisFunctionLearnerRow o,
DataRow r)
Compares coverage of this and another row. |
abstract double |
computeActivation(DataRow row)
Computes activation for a given row using this basis function. |
double |
computeCoverage(BasisFunctionLearnerRow bf)
Computes the intersection of instances covered by this and the other basisfunction - its fraction to the total number of instances is returned. |
abstract void |
cover(DataRow row)
Called if a row covers a new DataRow . |
(package private) void |
coverIntern(DataRow row)
Covers a new row and decrease covered counter. |
abstract boolean |
covers(DataRow row)
Returns true if the input row is covered by this row,
otherwise false . |
boolean |
equals(Object o)
Check if two BasisFunctionLearnerRow objects are equal if their centroids and class labels are equal. |
abstract boolean |
explains(DataRow row)
Returns true if the input row is explained by this row,
otherwise false . |
Set<RowKey> |
getAllCoveredPattern()
Returns a set which contains all input training pattern covered by this basis function. |
DataRow |
getAnchor()
Returns the basisfunction's anchor vector. |
DataCell |
getCell(int index)
Returns the DataCell at the provided index within this row. |
DataCell |
getClassLabel()
|
abstract DataCell |
getFinalCell(int index)
Returns a basis function cell for the given index. |
RowKey |
getKey()
Returns the row key. |
abstract DoubleValue |
getMissingValue(int col)
|
int |
getNumCells()
Returns the length of this row, that is the number of columns of the DataTable (not including the row key). |
abstract BasisFunctionPredictorRow |
getPredictorRow()
|
abstract boolean |
getShrinkValue(DataRow row)
Called if a new row has to be adjusted. |
double |
getVariance()
Returns the within-cluster variance. |
int |
hashCode()
Returns a hash code computed by the product of the hash code of anchor and class label. |
Iterator<DataCell> |
iterator()
|
void |
print(PrintStream out)
Writes information retrieved from the toString() method to the
given stream. |
abstract void |
reset()
Called if the algorithms starts a new run overall input pattern; some variables might need to be reset. |
(package private) void |
resetIntern()
Resets the number of covered pattern to zero and calls the abstract reset() . |
abstract boolean |
shrink(DataRow row)
Called if a new row has to be adjusted, all conflicting rows are shrunken. |
String |
toString()
Returns a string summary of this basis function cell including the assigned class, number of covered, as well as explained pattern. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected BasisFunctionLearnerRow(RowKey key, DataRow centroid, DataCell classInfo)
key
- of this rowcentroid
- the initial center vectorclassInfo
- the class info valueMethod Detail |
---|
public abstract BasisFunctionPredictorRow getPredictorRow()
public final DataRow getAnchor()
public int getNumCells()
getNumCells
in interface DataRow
public RowKey getKey()
getKey
in interface DataRow
public final DataCell getClassLabel()
public DataCell getCell(int index)
DataCell
at the provided index within this row.
getCell
in interface DataRow
index
- the index of the cell to retrieve (indices start from 0)
DataCell
at the given indexpublic Iterator<DataCell> iterator()
iterator
in interface Iterable<DataCell>
public abstract DataCell getFinalCell(int index)
index
- cell for index
public abstract DoubleValue getMissingValue(int col)
col
- the column index
public abstract boolean compareCoverage(BasisFunctionLearnerRow o, DataRow r)
this
covers better, return true
.
o
- the row to check withr
- the row to compute coverage on
true
this BasisFunction
covers
better than the other
NullPointerException
- if the given other
basis
function is null
public final Set<RowKey> getAllCoveredPattern()
public final double getVariance()
public final void addCovered(DataRow row, DataCell classInfo)
row
- to coverclassInfo
- and class.final void resetIntern()
reset()
.
final void coverIntern(DataRow row)
cover(DataRow)
method.
row
- the data row to coverpublic final double computeCoverage(BasisFunctionLearnerRow bf)
bf
- the other basisfunction to get covered instances from
public final void print(PrintStream out)
toString()
method to the
given stream.
out
- the PrintStream
to add info
NullPointerException
- if out
is null
.toString()
public String toString()
toString
in class Object
public abstract double computeActivation(DataRow row)
row
- the data row to compute activation with
public abstract boolean covers(DataRow row)
true
if the input row is covered by this row,
otherwise false
. Means, the minimum coverage criteria is
fulfilled.
row
- to check coverage
true
if covered, otherwise false
public abstract boolean explains(DataRow row)
true
if the input row is explained by this row,
otherwise false
. Means, the maximum coverage criteria is
fulfilled.
row
- to check coverage
true
if explained, otherwise false
public abstract boolean getShrinkValue(DataRow row)
row
- conflicting pattern
public abstract boolean shrink(DataRow row)
row
- conflicting pattern
true
if this basis function was effected by any
change, otherwise false
public abstract void reset()
public abstract void cover(DataRow row)
DataRow
.
row
- the new covered DataRow
public boolean equals(Object o)
equals
in class Object
o
- the other object to check
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |