- java.lang.Object
-
- org.ojalgo.data.cluster.FeatureBasedClusterer
-
- org.ojalgo.data.cluster.SpectralClusterer
-
- All Implemented Interfaces:
ClusteringAlgorithm<Point>
final class SpectralClusterer extends FeatureBasedClusterer
Spectral clustering forPoints using a fully connected RBF similarity graph and the symmetric normalised Laplacian. Pairwise distances are computed with the configuredDistanceMeasure; 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.
-
-
Field Summary
Fields Modifier and Type Field Description private FeatureBasedClusterermyClustererprivate intmyK
-
Constructor Summary
Constructors Constructor Description SpectralClusterer(int k, DistanceMeasure measure)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.util.Set<Point>>cluster(java.util.Collection<Point> input)Partitions the given items into clusters.-
Methods inherited from class org.ojalgo.data.cluster.FeatureBasedClusterer
centroid, cluster, distance, distance, getThreshold, initialiser, isSquared, newAutomatic, newAutomatic, newGreedy, newGreedy, newKMeans, newKMeans, newSpectral, newSpectral, setup
-
-
-
-
Field Detail
-
myK
private final int myK
-
myClusterer
private final FeatureBasedClusterer myClusterer
-
-
Constructor Detail
-
SpectralClusterer
SpectralClusterer(int k, DistanceMeasure measure)
-
-
Method Detail
-
cluster
public java.util.List<java.util.Set<Point>> cluster(java.util.Collection<Point> input)
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.
-
-