Spectral Clustering
Graph-based clustering for non-convex and complex-shaped clusters
Spectral Clustering constructs a similarity graph from the data and clusters its eigenspace representation. It can find non-convex, crescent-shaped, or ring-like clusters that K-Means cannot.
When to use:
- Non-convex or complex cluster shapes
- Graph or network data where community structure is meaningful
- When K-Means fails due to non-spherical clusters
Input: Tabular data with the feature columns defined during training Output: Cluster label for each row
Model Settings (set during training, used at inference)
N Clusters (default: 8) Number of clusters.
Affinity (default: rbf) Method to construct the similarity matrix:
rbf— Gaussian kernel (good default for continuous features)nearest_neighbors— k-NN graphprecomputed— provide a precomputed affinity matrix
N Neighbors (default: 10)
Number of neighbors for nearest_neighbors affinity.
Assign Labels (default: kmeans)
Algorithm for label assignment in eigenspace. kmeans is the standard choice.
Inference Settings
No dedicated inference-time settings. New points are assigned to the cluster of their nearest training neighbor via the learned graph structure.