jklustor-all-api-0.0.7-20140619012755 (ChemAxon)


com.chemaxon.clustering.common
Class IDBasedAssignerBuilder.IDBAssignerImpl

Object
  extended by com.chemaxon.clustering.common.IDBasedAssignerBuilder.IDBAssignerImpl
All Implemented Interfaces:
IDBasedAssigner, LevelAssigner<Integer,IDBasedHierarchicCluster>
Enclosing class:
IDBasedAssignerBuilder

static class IDBasedAssignerBuilder.IDBAssignerImpl
extends Object
implements IDBasedAssigner

Implementation for level assigner.


Constructor Summary
IDBasedAssignerBuilder.IDBAssignerImpl(IDBasedHierarchy hierarchy, IDBasedAssignerBuilder builder)
          Construct immutable assigner/
 
Method Summary
 double clusterLevel(IDBasedHierarchicCluster cluster)
          Level associated to a hierarchic cluster.
 int[] getClusterCountsForLevels()
          Cluster counts resulted from partitioning at associated distinct cluster levels.
 double[] getDistinctClusterLevels()
          Distinct cluster levels represented by this assigner.
 double leafLevel(Integer leaf)
          Level associated to a leaf object.
 double maxLevel()
          Maximal level associated.
 SingleLevelClustering<Integer,? extends Cluster<Integer>> partition(double clippingLevel)
          Create a partition of the associated hierarchic clustering at a specified level.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IDBasedAssignerBuilder.IDBAssignerImpl

IDBasedAssignerBuilder.IDBAssignerImpl(IDBasedHierarchy hierarchy,
                                       IDBasedAssignerBuilder builder)
Construct immutable assigner/

Parameters:
hierarchy - Associated clustering hierarchy
builder - Builder with level values
Method Detail

clusterLevel

public double clusterLevel(IDBasedHierarchicCluster cluster)
Description copied from interface: LevelAssigner
Level associated to a hierarchic cluster.

Specified by:
clusterLevel in interface LevelAssigner<Integer,IDBasedHierarchicCluster>
Parameters:
cluster - A cluster from the associated clustering
Returns:
Associated level

leafLevel

public double leafLevel(Integer leaf)
Description copied from interface: LevelAssigner
Level associated to a leaf object.

Specified by:
leafLevel in interface LevelAssigner<Integer,IDBasedHierarchicCluster>
Parameters:
leaf - A leaf
Returns:
Associated level

maxLevel

public double maxLevel()
Description copied from interface: LevelAssigner
Maximal level associated.

Specified by:
maxLevel in interface LevelAssigner<Integer,IDBasedHierarchicCluster>
Returns:
Maximal level associated to an object in the associated clustering.

partition

public SingleLevelClustering<Integer,? extends Cluster<Integer>> partition(double clippingLevel)
Description copied from interface: LevelAssigner
Create a partition of the associated hierarchic clustering at a specified level.

A partitioning would not cut clusters having exactly the same level. Clusters on the root side of the cut will dropped while ones on the leaf side will be collapsed. Nodes which are leaves in the dropped clusters (regardless of their level) will be considered as singleton clusters.

The partitioning is represented as a SingleLevelClustering.

Specified by:
partition in interface LevelAssigner<Integer,IDBasedHierarchicCluster>
Parameters:
clippingLevel - Level where cut should occur
Returns:
A partitioning of the represented clustering

getDistinctClusterLevels

public double[] getDistinctClusterLevels()
Description copied from interface: LevelAssigner
Distinct cluster levels represented by this assigner.

Please note that levels of singleton clusters (representing exactly one member) will also contribute to the returned array. A level introduced by only singleton clusters wont represent a change in the partitioning.

Specified by:
getDistinctClusterLevels in interface LevelAssigner<Integer,IDBasedHierarchicCluster>
Returns:
Distinct cluster level values, including 0.0 and value returned by LevelAssigner.maxLevel() in increasing order.

getClusterCountsForLevels

public int[] getClusterCountsForLevels()
Description copied from interface: LevelAssigner
Cluster counts resulted from partitioning at associated distinct cluster levels.

Partitioning done by LevelAssigner.partition(double) changes at distinct, non-singleton cluster levels (collected by LevelAssigner.getDistinctClusterLevels()). The returned array contains cluster counts resulted from partitioning at the associated level. Partitioning at level closer to the leaves ususally results in greater partition count.

Please note that the presence of singleton clusters might introduce new distinct levels (also returned by LevelAssigner.getDistinctClusterLevels() at which the partitioning wont change.

Specified by:
getClusterCountsForLevels in interface LevelAssigner<Integer,IDBasedHierarchicCluster>
Returns:
Partitioned cluster counts associated to levels

jklustor-all-api-0.0.7-20140619012755 (ChemAxon)