Class SpectralClusterer
java.lang.Object
org.ojalgo.data.cluster.FeatureBasedClusterer
org.ojalgo.data.cluster.SpectralClusterer
- All Implemented Interfaces:
ClusteringAlgorithm<Point>
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 invalid input: '<'= 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.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class FeatureBasedClusterer
centroid, cluster, distance, distance, getThreshold, initialiser, isSquared, newAutomatic, newAutomatic, newGreedy, newGreedy, newKMeans, newKMeans, newSpectral, newSpectral, setup
-
Field Details
-
myK
private final int myK -
myClusterer
-
-
Constructor Details
-
SpectralClusterer
SpectralClusterer(int k, DistanceMeasure measure)
-
-
Method Details
-
cluster
Description copied from interface:ClusteringAlgorithmPartitions the given items into clusters.- Parameters:
input- The items to cluster; must not benull. 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.
-