Interface LevelAssigner<L,T extends HierarchicCluster<L>>
- Type Parameters:
L
- Type of leavesT
- Type of clustersPlease note that this interface is marked with @Beta annotation, so it can be subject of incompatible changes or removal in later releases.
- All Known Subinterfaces:
IDBasedAssigner
-
Method Summary
Modifier and TypeMethodDescriptiondouble
clusterLevel
(T cluster) Level associated to a hierarchic cluster.CLuster level association.int[]
Cluster counts resulted from partitioning at associated distinct cluster levels.double[]
Distinct cluster levels represented by this assigner.double
Level associated to a leaf object.Leaf level association.double
maxLevel()
Maximal level associated.SingleLevelClustering<L,
? extends Cluster<L>> partition
(double clippingLevel) Create a partition of the associated hierarchic clustering at a specified level.
-
Method Details
-
clusterLevel
Level associated to a hierarchic cluster.- Parameters:
cluster
- A cluster from the associated clustering- Returns:
- Associated level
-
leafLevel
Level associated to a leaf object.- Parameters:
leaf
- A leaf- Returns:
- Associated level
-
maxLevel
double maxLevel()Maximal level associated.- Returns:
- Maximal level associated to an object in the associated clustering.
-
clusterLevelFunction
CLuster level association.- Returns:
Function
delegatingclusterLevel(com.chemaxon.clustering.common.HierarchicCluster)
-
leafLevelFunction
Leaf level association.- Returns:
Function
delegatingleafLevel(java.lang.Object)
-
getDistinctClusterLevels
double[] getDistinctClusterLevels()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.
- Returns:
- Distinct cluster level values, including 0.0 and value returned by
maxLevel()
in increasing order.
-
getClusterCountsForLevels
int[] getClusterCountsForLevels()Cluster counts resulted from partitioning at associated distinct cluster levels.Partitioning done by
partition(double)
changes at distinct, non-singleton cluster levels (collected bygetDistinctClusterLevels()
). 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
getDistinctClusterLevels()
at which the partitioning wont change.- Returns:
- Partitioned cluster counts associated to levels
-
partition
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
.- Parameters:
clippingLevel
- Level where cut should occur- Returns:
- A partitioning of the represented clustering
-