data
Class Node

java.lang.Object
  |
  +--data.Node

public class Node
extends java.lang.Object
This class provides all relevant information about the data associated with the corresponding node. This class is primarily used by the algorithmic classifiers.


Constructor Summary
Node(Step s)
 
Method Summary
 void addSplitIndex(int nAttributeIndex, int[] splitIndex)
          Activates the calculated (or selected) split points.
 boolean equalsClassifier(int nAttributeIndex, int pos, int nClassIndex)
 
 boolean equalsNextValue(int nAttributeIndex, int pos)
          This method compares the attribute value of an attribute 'nAttributeIndex' at the position 'k' with the value at the position 'k + 1'.
 int getClassifier(int nAttributeIndex, int pos)
 
 int getNumberOfAttributes()
 
 int getNumberOfClasses()
 
 int getNumberOfRecords()
 
 int getNumberOfRecordsWithClass(int nClassIndex)
 
 boolean isClassified()
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Node

public Node(Step s)
Method Detail

getNumberOfRecords

public int getNumberOfRecords()
Returns:
Number of records associated with this node.

getNumberOfAttributes

public int getNumberOfAttributes()
Returns:
Number of attributes in the data set.

getNumberOfClasses

public int getNumberOfClasses()
Returns:
Number of classes belonging to the data set associated with this node.

isClassified

public boolean isClassified()
Returns:
true, if the node is a leaf.

equalsNextValue

public boolean equalsNextValue(int nAttributeIndex,
                               int pos)
This method compares the attribute value of an attribute 'nAttributeIndex' at the position 'k' with the value at the position 'k + 1'.
 
Parameters:
nAttributeIndex - The index of the corresponding attribute.
pos - The position at which the attribute value should be compared with the next value.
Returns:
true, if attribute value at the position 'pos' equals attribute value at the position 'pos + 1'.
Throws:
java.lang.IndexOutOfBoundsException - If (pos < 0) or (pos > getNumOfRows()-2).

getClassifier

public int getClassifier(int nAttributeIndex,
                         int pos)
Parameters:
nAttributeIndex - The index of the attribute (0-based).
pos - The index of the records (0-based).
Returns:
The int-classifier of the corresponding record.
Throws:
java.lang.IndexOutOfBoundsException - if 'nAttributIndex' or 'pos' does not exist.

equalsClassifier

public boolean equalsClassifier(int nAttributeIndex,
                                int pos,
                                int nClassIndex)
Parameters:
nAttributeIndex - The index of the attribute (0-based).
pos - The index of the records (0-based).
Returns:
true, if the classifier at the position 'pos' in attribute 'nAttributeIndex' equals to the classifier 'nClassIndex'.
Throws:
java.lang.IndexOutOfBoundsException - if 'nAttributIndex' or 'pos' or 'ClassIndex' does not exist.

addSplitIndex

public void addSplitIndex(int nAttributeIndex,
                          int[] splitIndex)
Activates the calculated (or selected) split points.
 
Parameters:
nAttributeIndex - The index of the splitting attribute (0-based).
splitIndex - array of split points. The splitIndex 'splitIndex[n]' corresponds to the position AFTER which the split point should be set, i.e. it sets the split point between the position 'splitIndex[n]' and 'splitIndex[n]+1'.
Throws:
java.lang.IndexOutOfBoundsException - If some 'splitIndex[n]' does not exist.

getNumberOfRecordsWithClass

public int getNumberOfRecordsWithClass(int nClassIndex)
Returns:
The number of records with the class label 'nClassIndex'.
Throws:
java.lang.IndexOutOfBoundsException - If 'nClassIndex' does not exist.