Interface LevelAssigner<L,T extends HierarchicCluster<L>>

Type Parameters:
L - Type of leaves
T - Type of clusters

Please 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

@Beta @PublicAPI public interface LevelAssigner<L,T extends HierarchicCluster<L>>
Assigns levels for clusters and leaves.
  • Method Details

    • clusterLevel

      double clusterLevel(T cluster)
      Level associated to a hierarchic cluster.
      Parameters:
      cluster - A cluster from the associated clustering
      Returns:
      Associated level
    • leafLevel

      double leafLevel(L leaf)
      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

      Function<T,Double> clusterLevelFunction()
      CLuster level association.
      Returns:
      Function delegating clusterLevel(com.chemaxon.clustering.common.HierarchicCluster)
    • leafLevelFunction

      Function<L,Double> leafLevelFunction()
      Leaf level association.
      Returns:
      Function delegating leafLevel(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 by 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 getDistinctClusterLevels() at which the partitioning wont change.

      Returns:
      Partitioned cluster counts associated to levels
    • partition

      SingleLevelClustering<L,? extends Cluster<L>> partition(double clippingLevel)
      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