pub fn fit(
res: &Resources,
params: &Params,
x: &ManagedTensor,
sample_weight: &Option<ManagedTensor>,
centroids: &mut ManagedTensor,
) -> Result<(f64, i32)>Expand description
Find clusters with the k-means algorithm
ยงArguments
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)