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:

    public interface LevelAssigner<L,​T extends HierarchicCluster<L>>
    Assigns levels for clusters and leaves.
    • Method Detail

      • clusterLevel

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

        double leafLevel​(L leaf)
        Level associated to a leaf object.
        leaf - A leaf
        Associated level
      • maxLevel

        double maxLevel()
        Maximal level associated.
        Maximal level associated to an object in the associated clustering.
      • 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.

        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.

        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.

        clippingLevel - Level where cut should occur
        A partitioning of the represented clustering