com.rapidminer.operator.clustering
Class HierarchicalClusterNode

java.lang.Object
  extended by com.rapidminer.operator.clustering.HierarchicalClusterNode
Direct Known Subclasses:
HierarchicalClusterLeafNode

public class HierarchicalClusterNode
extends java.lang.Object

This class represents a not leaf node of a hierarchical cluster tree. It holds only references on the children and not on the contained examples. Hence contained examples are gathered recursivly from leaf nodes.

Author:
Sebastian Land

Constructor Summary
HierarchicalClusterNode(int clusterId, double distance)
           
HierarchicalClusterNode(java.lang.String clusterId)
           
HierarchicalClusterNode(java.lang.String clusterId, double distance)
           
 
Method Summary
 void addSubNode(HierarchicalClusterNode node)
           
 java.lang.String getClusterId()
           
 double getDistance()
          Get the weight of this node.
 java.util.Collection<java.lang.Object> getExampleIdsInSubtree()
          Get all objects (as representend by their IDs) in the subtree including the objects located directly at this node.
 int getNumberOfExamplesInSubtree()
          Returns the number of objects in the subtree including the objects at the current node.
 int getNumberOfSubNodes()
          Get the number of subnodes.
 java.util.Collection<HierarchicalClusterNode> getSubNodes()
          Get all children of this node.
 int getTotalNumberOfSubnodes()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HierarchicalClusterNode

public HierarchicalClusterNode(java.lang.String clusterId)

HierarchicalClusterNode

public HierarchicalClusterNode(int clusterId,
                               double distance)

HierarchicalClusterNode

public HierarchicalClusterNode(java.lang.String clusterId,
                               double distance)
Method Detail

getSubNodes

public java.util.Collection<HierarchicalClusterNode> getSubNodes()
Get all children of this node.

Returns:
Iterator of ClusterNode

getNumberOfSubNodes

public int getNumberOfSubNodes()
Get the number of subnodes.

Returns:
the number of subnodes.

getDistance

public double getDistance()
Get the weight of this node. This might represent similarity to another cluster or something else.

Returns:
double

getExampleIdsInSubtree

public java.util.Collection<java.lang.Object> getExampleIdsInSubtree()
Get all objects (as representend by their IDs) in the subtree including the objects located directly at this node. Note that objects can occur more than once.

Returns:
Iterator of String

getNumberOfExamplesInSubtree

public int getNumberOfExamplesInSubtree()
Returns the number of objects in the subtree including the objects at the current node. Note that objects can occur more than once and are counted as such. To get the number of distinct objects use the getObjectsInSubtree function first and use the resulting list to calculate the number of distinct objects.

Returns:
number of objects

addSubNode

public void addSubNode(HierarchicalClusterNode node)

getTotalNumberOfSubnodes

public int getTotalNumberOfSubnodes()

getClusterId

public java.lang.String getClusterId()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2001-2009 by Rapid-I