fit

Function fit 

Source
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 use
  • params - Parameters to use to fit KMeans model
  • x - 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)