predict

Function predict 

Source
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 use
  • params - Parameters to use to fit KMeans model
  • x - 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 labels
  • normalize_weight - whether or not to normalize the weights