Expand description
Clustering algorithms for Rust.
§Examples
use gathers::kmeans::{KMeans, rabitq_assign};
use gathers::utils::as_continuous_vec;
let kmeans = KMeans::default();
let num = vecs.len();
let dim = vecs[0].len();
// fit
let centroids = kmeans.fit(as_continuous_vec(&vecs), dim);
// predict
let mut labels = vec![0; num];
rabitq_assign(&as_continuous_vec(&vecs), ¢roids, dim, &mut labels);