com.rapidminer.operator.clustering
Class HierarchicalClusterLeafNode

java.lang.Object
  extended by com.rapidminer.operator.clustering.HierarchicalClusterNode
      extended by com.rapidminer.operator.clustering.HierarchicalClusterLeafNode

public class HierarchicalClusterLeafNode
extends HierarchicalClusterNode

This class is an extension of the HierarchicalClusterNode, representing the leaf nodes of a hierarchical cluster tree. These Nodes are the only nodes containing the links to examples by storing example ids.

Author:
Sebastian Land

Constructor Summary
HierarchicalClusterLeafNode(int clusterId, java.util.Collection<java.lang.Object> exampleIds)
           
HierarchicalClusterLeafNode(int clusterId, java.lang.Object exampleId)
           
HierarchicalClusterLeafNode(java.lang.String clusterId)
           
HierarchicalClusterLeafNode(java.lang.String clusterId, java.util.Collection<java.lang.Object> exampleIds)
           
 
Method Summary
 void addSubNode(HierarchicalClusterLeafNode node)
           
 double getDistance()
          Get the weight of this node.
 java.util.Collection<java.lang.Object> getExampleIdsInSubtree()
          Get all objects (as representend by their IDs) in this leaf.
 int getNumberOfExamplesInSubtree()
          Returns the number of objects in the subtree including the objects at the current node.
 int getNumberOfSubNodes()
          Get the number of subnodes: Is always 0 since this node is leaf
 java.util.Collection<HierarchicalClusterNode> getSubNodes()
          Returns an empty collection since it is leaf
 java.lang.String toString()
           
 
Methods inherited from class com.rapidminer.operator.clustering.HierarchicalClusterNode
addSubNode, getClusterId, getTotalNumberOfSubnodes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HierarchicalClusterLeafNode

public HierarchicalClusterLeafNode(java.lang.String clusterId)

HierarchicalClusterLeafNode

public HierarchicalClusterLeafNode(java.lang.String clusterId,
                                   java.util.Collection<java.lang.Object> exampleIds)

HierarchicalClusterLeafNode

public HierarchicalClusterLeafNode(int clusterId,
                                   java.util.Collection<java.lang.Object> exampleIds)

HierarchicalClusterLeafNode

public HierarchicalClusterLeafNode(int clusterId,
                                   java.lang.Object exampleId)
Method Detail

getSubNodes

public java.util.Collection<HierarchicalClusterNode> getSubNodes()
Returns an empty collection since it is leaf

Overrides:
getSubNodes in class HierarchicalClusterNode
Returns:
Iterator of ClusterNode

getNumberOfSubNodes

public int getNumberOfSubNodes()
Get the number of subnodes: Is always 0 since this node is leaf

Overrides:
getNumberOfSubNodes in class HierarchicalClusterNode
Returns:
the number of subnodes.

getDistance

public double getDistance()
Description copied from class: HierarchicalClusterNode
Get the weight of this node. This might represent similarity to another cluster or something else.

Overrides:
getDistance in class HierarchicalClusterNode
Returns:
double

getExampleIdsInSubtree

public java.util.Collection<java.lang.Object> getExampleIdsInSubtree()
Get all objects (as representend by their IDs) in this leaf.

Overrides:
getExampleIdsInSubtree in class HierarchicalClusterNode
Returns:
Iterator of String

getNumberOfExamplesInSubtree

public int getNumberOfExamplesInSubtree()
Description copied from class: HierarchicalClusterNode
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.

Overrides:
getNumberOfExamplesInSubtree in class HierarchicalClusterNode
Returns:
number of objects

addSubNode

public void addSubNode(HierarchicalClusterLeafNode node)

toString

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


Copyright © 2001-2009 by Rapid-I