Rust module: cuvs::cluster::kmeans
Source: rust/cuvs/src/cluster/kmeans/mod.rs
Kmeans clustering API’s
Example:
Source: rust/cuvs/src/cluster/kmeans/mod.rs:40
Find clusters with the k-means algorithm
res - Resources to useparams - Parameters to use to fit KMeans modelx - A matrix in device memory - shape (m, k)sample_weight - Optional device matrix shape (n_clusters, 1)centroids - Output device matrix, that has the centroids for each cluster
shape (n_clusters, k)Source: rust/cuvs/src/cluster/kmeans/mod.rs:56
Predict clusters with the k-means algorithm
res - Resources to useparams - Parameters to use to fit KMeans modelx - Input matrix in device memory - shape (m, k)sample_weight - Optional device matrix shape (n_clusters, 1)centroids - Centroids calculated by fit in device memory, shape (n_clusters, k)labels - preallocated CUDA array interface matrix shape (m, 1) to hold the output labelsnormalize_weight - whether or not to normalize the weightsSource: rust/cuvs/src/cluster/kmeans/mod.rs:95
Compute cluster cost given an input matrix and existing centroids
res - Resources to usex - Input matrix in device memory - shape (m, k)centroids - Centroids calculated by fit in device memory, shape (n_clusters, k)Source: rust/cuvs/src/cluster/kmeans/mod.rs:131