Kmeans

View as Markdown

Python module: cuvs.cluster.mg.kmeans

fit

@auto_sync_multi_gpu_resources

1def fit( KMeansParams params, X, centroids=None, sample_weights=None, resources=None )

Find clusters with single-node multi-GPU k-means using host data.

Parameters

NameTypeDescription
paramsKMeansParamsParameters to use to fit KMeans model.
Xhost array-likeTraining instances, shape (m, k). Must be C-contiguous float32 or float64 host data.
centroidshost array-like, optionalInitial centroids when params.init_method == "Array" and output centroids for all init methods. If omitted, a host NumPy output array is allocated unless init_method == "Array".
sample_weightshost array-like, optionalOptional weights per observation. Must be C-contiguous and have the same dtype as X.
resourcescuvs.common.Resources, optional

Returns

FitOutput centroids is a host NumPy array containing the computed centroids, inertia is the final objective value, and n_iter is the number of iterations run.