1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
# src/spectral ## Purpose Spectral clustering using affinity matrix + Laplacian + eigendecomposition via faer. Used by NmeScClusterer. ## Surfaces - `spectral_cluster(embeddings, max_k) -> Vec<usize>` ## Dependencies - `utils` — cosine_similarity - `faer` — SVD/eigendecomposition ## Invariants - Output labels are contiguous integers starting from 0. ## Verification ```bash cargo test --lib spectral --features spectral ``` ## Notes - Requires `spectral` feature (pulls faer).