/** * Result of `kmeans`: the cluster label of each row, the centroids, and the total * within-cluster sum of squares (`inertia`). */ export interface KMeansResult { labels: number[]; centroids: number[][]; inertia: number; /** Number of Lloyd iterations actually run. */ iterations: number; /** True if the assignment stabilized before `maxIter` (false = hit the cap). */ converged: boolean; } /** * k-means clustering (Lloyd's algorithm) of row-vectors `data` into `k` clusters. * Deterministic maximin seeding (farthest-point), so repeated runs agree. Returns * cluster `labels`, `centroids`, and the total within-cluster sum of squares (`inertia`). */ export declare function kmeans(data: readonly number[][], k: number, opts?: { maxIter?: number; }): KMeansResult; /** * Spectral clustering of a weighted graph given by its adjacency matrix into `k` * clusters. Embeds nodes via the `k` smallest eigenvectors of the symmetric * normalized Laplacian (reusing `laplacianMatrix` + `eigs`), then k-means on the * embedding. Returns a label per node. */ export declare function spectralClustering(adjacency: readonly number[][], k: number, opts?: { maxIter?: number; }): number[]; //# sourceMappingURL=clustering-extra.d.ts.map