|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.base.node.mine.cluster.hierarchical.ClusterNode
public class ClusterNode
Represents a Node in the hierarchy tree (Dendrogram) of a hierarchical clustering.
Constructor Summary | |
---|---|
ClusterNode(ClusterNode node1,
ClusterNode node2,
double dist)
Constructs a new parent node from two child nodes. |
|
ClusterNode(DataRow row,
int rowIdx)
Constructs a new leaf node from a data row. |
Method Summary | |
---|---|
DataRow[] |
getAllDataRows()
Returns all data row (leaf nodes) this sub tree. |
double |
getDist()
Returns the distance between the two children nodes on the next level. |
ClusterNode |
getFirstSubnode()
Returns the first sub-node of this node. |
int |
getLeafCount()
Returns the number of leaf nodes contained in this node. |
DataRow |
getLeafDataPoint()
Returns the DataRow associated with a leaf node. |
double |
getMaxDistance()
Returns the maximum distance from this node to any of the leafs. |
int |
getRowIndex()
Returns the index of the row stored inside this leaf node. |
ClusterNode |
getSecondSubnode()
Returns the second sub-node of this node. |
boolean |
isLeaf()
Returns if this node is a leaf. |
Iterable<ClusterNode> |
leafs()
Returns an Iterable over all leaf nodes contained in this node. |
static ClusterNode |
loadFromXML(NodeSettingsRO settings,
DataArray orgTable)
Loads a cluster node from the settings. |
void |
saveToXML(NodeSettingsWO settings)
Saves the tree structure into the config. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ClusterNode(DataRow row, int rowIdx)
row
- data row to create a node forrowIdx
- the row index for later reconstruction in load/save
internals.public ClusterNode(ClusterNode node1, ClusterNode node2, double dist)
node1
- the first node to create a parent node fornode2
- the second node to create a parent node fordist
- the distance to the node.Method Detail |
---|
public int getRowIndex()
public DataRow[] getAllDataRows()
public Iterable<ClusterNode> leafs()
public int getLeafCount()
public ClusterNode getFirstSubnode()
getFirstSubnode
in interface DendrogramNode
public double getDist()
getDist
in interface DendrogramNode
public boolean isLeaf()
isLeaf
in interface DendrogramNode
true
if the node is a leaf node,
false
otherwisepublic double getMaxDistance()
getMaxDistance
in interface DendrogramNode
public DataRow getLeafDataPoint()
getLeafDataPoint
in interface DendrogramNode
null
if this node is not a
leafpublic ClusterNode getSecondSubnode()
getSecondSubnode
in interface DendrogramNode
public String toString()
toString
in class Object
public void saveToXML(NodeSettingsWO settings)
settings
- the config to save to.public static ClusterNode loadFromXML(NodeSettingsRO settings, DataArray orgTable) throws InvalidSettingsException
settings
- the config to load fromorgTable
- the original table containing the rows in the same order!
InvalidSettingsException
- if not stored properly.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |