|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.myra.antree.representation.Node
public abstract class Node
Field Summary | |
---|---|
static int |
INITIAL_LEVEL
The first level of the tree (the level of the root node). |
Constructor Summary | |
---|---|
Node(int level,
net.sf.myra.datamining.data.Attribute attribute)
Creates a new node. |
|
Node(int level,
net.sf.myra.datamining.data.Attribute attribute,
Branch[] branches)
Creates a new node. |
Method Summary | |
---|---|
Node |
clone()
|
boolean |
equals(java.lang.Object o)
|
net.sf.myra.datamining.data.Attribute |
getAttribute()
Returns the attribute that this node represents. |
Branch |
getBranch(double value)
Returns the branch that corresponds to the specified value. |
Branch |
getBranch(int index)
Returns the branch given the specified index. |
Branch |
getBranch(Node node)
Returns the branch that leads to the specified node. |
Branch[] |
getBranches()
Returns the branches originating from this node. |
int |
getLevel()
Returns the level of this node. |
Node |
getParent()
Returns the parent node of this node. |
abstract net.sf.myra.datamining.data.Label |
getPrediction()
Returns the label predicted by the node. |
int |
hashCode()
|
boolean |
isLeaf()
Indicates if this node is a leaf node or not. |
abstract java.lang.String |
label()
Returns a label representation of this node. |
void |
setLevel(int level)
Sets the level of this node. |
abstract void |
setPrediction(net.sf.myra.datamining.data.Label prediction)
Sets the prediction of the node. |
java.lang.String |
toString()
|
boolean |
validate()
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int INITIAL_LEVEL
Constructor Detail |
---|
public Node(int level, net.sf.myra.datamining.data.Attribute attribute)
level
- the level of the node.attribute
- the attribute that this node represents.public Node(int level, net.sf.myra.datamining.data.Attribute attribute, Branch[] branches)
level
- the level of the node.attribute
- the attribute represented by the node.branches
- the branches originating from this node.Method Detail |
---|
public int getLevel()
public void setLevel(int level)
level
- the level to set.public net.sf.myra.datamining.data.Attribute getAttribute()
public Node getParent()
public Branch getBranch(int index)
index
- the index of the branch.
public Branch getBranch(Node node)
node
-
public Branch getBranch(double value)
value
- the value to test.
public Branch[] getBranches()
public final boolean isLeaf()
getPrediction()
method.
true
if this node is a leaf node; false
otherwise.getPrediction()
public abstract java.lang.String label()
public abstract net.sf.myra.datamining.data.Label getPrediction()
public abstract void setPrediction(net.sf.myra.datamining.data.Label prediction)
prediction
- the prediction to set.public final boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public final int hashCode()
hashCode
in class java.lang.Object
public Node clone()
clone
in class java.lang.Object
public final java.lang.String toString()
toString
in class java.lang.Object
public boolean validate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |