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