Skip to main content

cuvsKMeansPredict

Function cuvsKMeansPredict 

Source
pub unsafe extern "C" fn cuvsKMeansPredict(
    res: cuvsResources_t,
    params: cuvsKMeansParams_t,
    X: *mut DLManagedTensor,
    sample_weight: *mut DLManagedTensor,
    centroids: *mut DLManagedTensor,
    labels: *mut DLManagedTensor,
    normalize_weight: bool,
    inertia: *mut f64,
) -> cuvsError_t
Expand description

@brief Predict the closest cluster each sample in X belongs to.

@param[in] res opaque C handle @param[in] params Parameters for KMeans model. @param[in] X New data to predict. [dim = n_samples x n_features] @param[in] sample_weight Optional weights for each observation in X. [len = n_samples] @param[in] centroids Cluster centroids. The data must be in row-major format. [dim = n_clusters x n_features] @param[in] normalize_weight True if the weights should be normalized @param[out] labels Index of the cluster each sample in X belongs to. [len = n_samples] @param[out] inertia Sum of squared distances of samples to their closest cluster center.