Crate gathers

Source
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), &centroids, dim, &mut labels);

Modules§

distance
Compute the distance between vectors.
kmeans
K-means clustering implementation.
rabitq
A minimal RaBitQ implementation for top-1 retrieval.
sampling
Down sampling methods.
simd
Accelerate with SIMD.
utils
Utility functions for manipulating vectors and reading/writing files.