Module ojalgo

Class SpectralClusterer

  • All Implemented Interfaces:
    ClusteringAlgorithm<Point>

    final class SpectralClusterer
    extends FeatureBasedClusterer
    Spectral clustering for Points using a fully connected RBF similarity graph and the symmetric normalised Laplacian. Pairwise distances are computed with the configured DistanceMeasure; the kernel scale is set from the median distance. The algorithm computes the k eigenvectors corresponding to the smallest eigenvalues of L = I - D^{-1/2} W D^{-1/2}, row-normalises the embedding, runs k-means, and maps clusters back to the original points. For n == 0 it returns empty; for n <= k it returns singletons. Requires point ids contiguous in [0,n). Complexity dominated by O(n^2) pairwise work and an eigen-decomposition of the n×n Laplacian.
    • Constructor Detail

    • Method Detail

      • cluster

        public java.util.List<java.util.Set<Point>> cluster​(java.util.Collection<Point> input)
        Description copied from interface: ClusteringAlgorithm
        Partitions the given items into clusters.
        Parameters:
        input - The items to cluster; must not be null. May be empty.
        Returns:
        A list of clusters; each element of the list is a Set<T> representing one cluster and containing its members. Sets are non-empty and pairwise disjoint; ordering is unspecified.