methods.clustering
Class HierarchicalTreeNode

java.lang.Object
  extended by methods.clustering.HierarchicalTreeNode

public class HierarchicalTreeNode
extends Object

Represents one node of the tree generated by hierarchical agglomerative clustering. This tree is constructed bottom up and represents the order of agglomerations performed during the clustering. Similarities in the tree are monotonically decreasing from the leaf to the root. A cutoff can be applied on this tree to cut it at a given level of similarity and derive a clustering from the tree.

This class only contains one public method to derive a complex set from the root tree node returned by clustering method.

Author:
Jan Krumsiek

Field Summary
protected  Collection<HierarchicalTreeNode> children
          List of children for this tree node.
protected  int label
          Contains the item associated with this node if this is a leaf node or -1 if this is an inner node
protected  float similarity
          Similarity at which the children of this node were merged
 
Constructor Summary
protected HierarchicalTreeNode(int label)
          Constructor which takes an item identifier but no similarity (for the leaf nodes)
protected HierarchicalTreeNode(int label, float similarity)
          Constructor which takes an item and a merging similarity
 
Method Summary
protected  void addChild(HierarchicalTreeNode child)
          add a child to this node
 ComplexSet extractClustering(float threshold)
          Extracts a clustering from this tree by cutting it a given similarity threshold value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

similarity

protected float similarity
Similarity at which the children of this node were merged


children

protected Collection<HierarchicalTreeNode> children
List of children for this tree node. Should always contain two items as hierarchical agglomerative clustering create binary trees.


label

protected int label
Contains the item associated with this node if this is a leaf node or -1 if this is an inner node

Constructor Detail

HierarchicalTreeNode

protected HierarchicalTreeNode(int label)
Constructor which takes an item identifier but no similarity (for the leaf nodes)


HierarchicalTreeNode

protected HierarchicalTreeNode(int label,
                               float similarity)
Constructor which takes an item and a merging similarity

Method Detail

addChild

protected void addChild(HierarchicalTreeNode child)
add a child to this node


extractClustering

public ComplexSet extractClustering(float threshold)
Extracts a clustering from this tree by cutting it a given similarity threshold value.

Parameters:
threshold - cutoff similarity value
Returns:
resulting clustering