Namespaces | Typedefs | Functions
ML::kmeans Namespace Reference

Namespaces

 opg
 

Typedefs

using KMeansParams = cuvs::cluster::kmeans::params
 

Functions

void fit_predict (const raft::handle_t &handle, const KMeansParams &params, const float *X, int n_samples, int n_features, const float *sample_weight, float *centroids, int *labels, float &inertia, int &n_iter)
 Compute k-means clustering and predicts cluster index for each sample in the input. More...
 
void fit_predict (const raft::handle_t &handle, const KMeansParams &params, const double *X, int n_samples, int n_features, const double *sample_weight, double *centroids, int *labels, double &inertia, int &n_iter)
 
void fit_predict (const raft::handle_t &handle, const KMeansParams &params, const float *X, int64_t n_samples, int64_t n_features, const float *sample_weight, float *centroids, int64_t *labels, float &inertia, int64_t &n_iter)
 
void fit_predict (const raft::handle_t &handle, const KMeansParams &params, const double *X, int64_t n_samples, int64_t n_features, const double *sample_weight, double *centroids, int64_t *labels, double &inertia, int64_t &n_iter)
 
void predict (const raft::handle_t &handle, const KMeansParams &params, const float *centroids, const float *X, int n_samples, int n_features, const float *sample_weight, bool normalize_weights, int *labels, float &inertia)
 Predict the closest cluster each sample in X belongs to. More...
 
void predict (const raft::handle_t &handle, const KMeansParams &params, const double *centroids, const double *X, int n_samples, int n_features, const double *sample_weight, bool normalize_weights, int *labels, double &inertia)
 
void predict (const raft::handle_t &handle, const KMeansParams &params, const float *centroids, const float *X, int64_t n_samples, int64_t n_features, const float *sample_weight, bool normalize_weights, int64_t *labels, float &inertia)
 
void predict (const raft::handle_t &handle, const KMeansParams &params, const double *centroids, const double *X, int64_t n_samples, int64_t n_features, const double *sample_weight, bool normalize_weights, int64_t *labels, double &inertia)
 
void transform (const raft::handle_t &handle, const KMeansParams &params, const float *centroids, const float *X, int n_samples, int n_features, float *X_new)
 Transform X to a cluster-distance space. More...
 
void transform (const raft::handle_t &handle, const KMeansParams &params, const double *centroids, const double *X, int n_samples, int n_features, double *X_new)
 
void transform (const raft::handle_t &handle, const KMeansParams &params, const float *centroids, const float *X, int64_t n_samples, int64_t n_features, float *X_new)
 
void transform (const raft::handle_t &handle, const KMeansParams &params, const double *centroids, const double *X, int64_t n_samples, int64_t n_features, double *X_new)
 

Typedef Documentation

◆ KMeansParams

using ML::kmeans::KMeansParams = typedef cuvs::cluster::kmeans::params

Function Documentation

◆ fit_predict() [1/4]

void ML::kmeans::fit_predict ( const raft::handle_t &  handle,
const KMeansParams params,
const double *  X,
int  n_samples,
int  n_features,
const double *  sample_weight,
double *  centroids,
int *  labels,
double &  inertia,
int &  n_iter 
)

◆ fit_predict() [2/4]

void ML::kmeans::fit_predict ( const raft::handle_t &  handle,
const KMeansParams params,
const double *  X,
int64_t  n_samples,
int64_t  n_features,
const double *  sample_weight,
double *  centroids,
int64_t *  labels,
double &  inertia,
int64_t &  n_iter 
)

◆ fit_predict() [3/4]

void ML::kmeans::fit_predict ( const raft::handle_t &  handle,
const KMeansParams params,
const float *  X,
int  n_samples,
int  n_features,
const float *  sample_weight,
float *  centroids,
int *  labels,
float &  inertia,
int &  n_iter 
)

Compute k-means clustering and predicts cluster index for each sample in the input.

Parameters
[in]handleThe handle to the cuML library context that manages the CUDA resources.
[in]paramsParameters for KMeans model.
[in]XTraining instances to cluster. It must be noted that the data must be in row-major format and stored in device accessible location.
[in]n_samplesNumber of samples in the input X.
[in]n_featuresNumber of features or the dimensions of each sample.
[in]sample_weightThe weights for each observation in X.
[in,out]centroids[in] When init is InitMethod::Array, use centroids as the initial cluster centers [out] Otherwise, generated centroids from the kmeans algorithm is stored at the address pointed by 'centroids'.
[out]labelsIndex of the cluster each sample in X belongs to.
[out]inertiaSum of squared distances of samples to their closest cluster center.
[out]n_iterNumber of iterations run.

◆ fit_predict() [4/4]

void ML::kmeans::fit_predict ( const raft::handle_t &  handle,
const KMeansParams params,
const float *  X,
int64_t  n_samples,
int64_t  n_features,
const float *  sample_weight,
float *  centroids,
int64_t *  labels,
float &  inertia,
int64_t &  n_iter 
)

◆ predict() [1/4]

void ML::kmeans::predict ( const raft::handle_t &  handle,
const KMeansParams params,
const double *  centroids,
const double *  X,
int  n_samples,
int  n_features,
const double *  sample_weight,
bool  normalize_weights,
int *  labels,
double &  inertia 
)

◆ predict() [2/4]

void ML::kmeans::predict ( const raft::handle_t &  handle,
const KMeansParams params,
const double *  centroids,
const double *  X,
int64_t  n_samples,
int64_t  n_features,
const double *  sample_weight,
bool  normalize_weights,
int64_t *  labels,
double &  inertia 
)

◆ predict() [3/4]

void ML::kmeans::predict ( const raft::handle_t &  handle,
const KMeansParams params,
const float *  centroids,
const float *  X,
int  n_samples,
int  n_features,
const float *  sample_weight,
bool  normalize_weights,
int *  labels,
float &  inertia 
)

Predict the closest cluster each sample in X belongs to.

Parameters
[in]handleThe handle to the cuML library context that manages the CUDA resources.
[in]paramsParameters for KMeans model.
[in]centroidsCluster centroids. It must be noted that the data must be in row-major format and stored in device accessible location.
[in]XNew data to predict.
[in]n_samplesNumber of samples in the input X.
[in]n_featuresNumber of features or the dimensions of each sample in 'X' (value should be same as the dimension for each cluster centers in 'centroids').
[in]sample_weightThe weights for each observation in X.
[in]normalize_weightsTrue if the weights should be normalized
[out]labelsIndex of the cluster each sample in X belongs to.
[out]inertiaSum of squared distances of samples to their closest cluster center.

◆ predict() [4/4]

void ML::kmeans::predict ( const raft::handle_t &  handle,
const KMeansParams params,
const float *  centroids,
const float *  X,
int64_t  n_samples,
int64_t  n_features,
const float *  sample_weight,
bool  normalize_weights,
int64_t *  labels,
float &  inertia 
)

◆ transform() [1/4]

void ML::kmeans::transform ( const raft::handle_t &  handle,
const KMeansParams params,
const double *  centroids,
const double *  X,
int  n_samples,
int  n_features,
double *  X_new 
)

◆ transform() [2/4]

void ML::kmeans::transform ( const raft::handle_t &  handle,
const KMeansParams params,
const double *  centroids,
const double *  X,
int64_t  n_samples,
int64_t  n_features,
double *  X_new 
)

◆ transform() [3/4]

void ML::kmeans::transform ( const raft::handle_t &  handle,
const KMeansParams params,
const float *  centroids,
const float *  X,
int  n_samples,
int  n_features,
float *  X_new 
)

Transform X to a cluster-distance space.

Parameters
[in]handleThe handle to the cuML library context that manages the CUDA resources.
[in]paramsParameters for KMeans model.
[in]centroidsCluster centroids. It must be noted that the data must be in row-major format and stored in device accessible location.
[in]XTraining instances to cluster. It must be noted that the data must be in row-major format and stored in device accessible location.
[in]n_samplesNumber of samples in the input X.
[in]n_featuresNumber of features or the dimensions of each sample in 'X' (it should be same as the dimension for each cluster centers in 'centroids').
[out]X_newX transformed in the new space..

◆ transform() [4/4]

void ML::kmeans::transform ( const raft::handle_t &  handle,
const KMeansParams params,
const float *  centroids,
const float *  X,
int64_t  n_samples,
int64_t  n_features,
float *  X_new 
)