emeans 0.1.0
Initial CRAN release: an R port of the e-means clustering in faiss (contrib/e_means, commit 2b648f0605f2ef3d14c4705350f8a0b214463878).
-
emeans()fits e-means, a mini-batch alternative to k-means, and returns an"emeans"object with the samecluster,centers,totss,withinss,tot.withinss,betweenssandsizeas akmeans()fit, from a closing sweep that labels every training row by its nearest final center. It supports Euclidean and spherical clustering, amax_points_per_centroidsubsample, user-supplied starting centers and fractionalnepochs. Randomness comes from R’s RNG, soset.seed()makes a fit reproducible. -
print(),summary(),predict()andfitted()methods for"emeans"objects. - Experimental
em_begin(),em_accumulate(),em_update(),em_end_epoch(),em_finalize()andem_centers()run training one batch at a time, for data that does not fit in memory. - C++ CPU kernels (Rcpp, RcppArmadillo, optional OpenMP) in double precision, with a direct kernel and a blocked BLAS kernel.
options(emeans.kernel =)selects between them andoptions(emeans.threads =)sets the default thread count. - Optional GPU path through the {torch} package (float32):
device = "mps"for Apple GPUs,"torch:cpu"and an experimental"cuda"that has not yet been tested on NVIDIA hardware. -
tidy(),glance()andaugment()methods for {generics}, following broom’s columns forkmeans(), and an"emeans"engine fortidyclust::k_means(). - Results were cross-checked pass by pass against the upstream Python implementation with replayed random draws; see
tools/crosscheck/in the GitHub repository. - Four vignettes: getting started, large data, tidymodels and GPU.