Functions
C-wrapper to C++ implementation of Support Vector Machine

Functions

cumlError_t cumlSpSvcFit (cumlHandle_t handle, float *input, int n_rows, int n_cols, float *labels, float C, float cache_size, int max_iter, int nochange_steps, float tol, int verbosity, cumlSvmKernelType kernel, int degree, float gamma, float coef0, int *n_support, float *b, float **dual_coefs, float **x_support, int **support_idx, int *n_classes, float **unique_labels)
 
cumlError_t cumlDpSvcFit (cumlHandle_t handle, double *input, int n_rows, int n_cols, double *labels, double C, double cache_size, int max_iter, int nochange_steps, double tol, int verbosity, cumlSvmKernelType kernel, int degree, double gamma, double coef0, int *n_support, double *b, double **dual_coefs, double **x_support, int **support_idx, int *n_classes, double **unique_labels)
 
cumlError_t cumlSpSvcPredict (cumlHandle_t handle, float *input, int n_rows, int n_cols, cumlSvmKernelType kernel, int degree, float gamma, float coef0, int n_support, float b, float *dual_coefs, float *x_support, int n_classes, float *unique_labels, float *preds, float buffer_size, int predict_class)
 
cumlError_t cumlDpSvcPredict (cumlHandle_t handle, double *input, int n_rows, int n_cols, cumlSvmKernelType kernel, int degree, double gamma, double coef0, int n_support, double b, double *dual_coefs, double *x_support, int n_classes, double *unique_labels, double *preds, double buffer_size, int predict_class)
 

Detailed Description

The output device buffers shall be unallocated on entry. Note that n_support, n_classes and b are host scalars, all other output pointers are device pointers.

Parameters
[in]handlethe cuML handle
[in]inputdevice pointer for the input data in column major format. Size n_rows x n_cols.
[in]n_rowsnumber of rows
[in]n_colsnumber of columns
[in]labelsdevice pointer for the labels. Size n_rows.
[in]Cpenalty term
[in]cache_sizesize of kernel cache in device memory (MiB)
[in]max_itermaximum number of outer iterations in SmoSolver
[in]nochange_stepsmax number of outer iterations without change in convergence
[in]toltolerance to stop fitting
[in]verbosityFine grained control over logging of useful information as algorithm executes. Currently passing anything greater than or equal to CUML_LEVEL_INFO will make it execute quietly
[in]kerneltype of kernel (LINEAR, POLYNOMIAL, RBF or TANH)
[in]degreeof polynomial kernel (ignored by others)
[in]gammamultiplier in the RBF, POLYNOMIAL and TANH kernels
[in]coef0additive constant in poly and tanh kernels
[out]n_supportnumber of support vectors
[out]bconstant used in the decision function
[out]dual_coefsnon-zero dual coefficients, size [n_support].
[out]x_supportsupport vectors in column major format. Size [n_support x n_cols].
[out]support_idxindices (from the traning set) of the support vectors, size [n_support].
[out]n_classesnumber of classes found in the input labels
[out]unique_labelsdevice pointer for the unique classes, size [n_classes]
Returns
CUML_SUCCESS on success and other corresponding flags upon any failures.

The output preds array shall be allocated on entry.

Parameters
[in]handlethe cuML handle
[in]inputdevice pointer for the input data in column major format. Size n_rows x n_cols.
[in]n_rowsnumber of rows
[in]n_colsnumber of columns
[in]kerneltype of kernel (LINEAR, POLYNOMIAL, RBF or TANH)
[in]degreeof polynomial kernel (ignored by others)
[in]gammamultiplier in the RBF, POLYNOMIAL and TANH kernels
[in]coef0additive constant in poly and tanh kernels
[in]n_supportnumber of support vectors
[in]bconstant used in the decision function
[in]dual_coefsnon-zero dual coefficients, size [n_support].
[in]x_supportsupport vectors in column major format. Size [n_support x n_cols].
[in]n_classesnumber of classes found in the input labels
[in]unique_labelsdevice pointer for the unique classes, size [n_classes]
[out]predsdevice pointer for the predictions. Size [n_rows].
[in]buffer_sizesize of temporary buffer in MiB
[in]predict_classwhether to predict class label (true), or just return the decision function value (false)
Returns
CUML_SUCCESS on success and other corresponding flags upon any failures.

Function Documentation

◆ cumlDpSvcFit()

cumlError_t cumlDpSvcFit ( cumlHandle_t  handle,
double *  input,
int  n_rows,
int  n_cols,
double *  labels,
double  C,
double  cache_size,
int  max_iter,
int  nochange_steps,
double  tol,
int  verbosity,
cumlSvmKernelType  kernel,
int  degree,
double  gamma,
double  coef0,
int *  n_support,
double *  b,
double **  dual_coefs,
double **  x_support,
int **  support_idx,
int *  n_classes,
double **  unique_labels 
)

◆ cumlDpSvcPredict()

cumlError_t cumlDpSvcPredict ( cumlHandle_t  handle,
double *  input,
int  n_rows,
int  n_cols,
cumlSvmKernelType  kernel,
int  degree,
double  gamma,
double  coef0,
int  n_support,
double  b,
double *  dual_coefs,
double *  x_support,
int  n_classes,
double *  unique_labels,
double *  preds,
double  buffer_size,
int  predict_class 
)

◆ cumlSpSvcFit()

cumlError_t cumlSpSvcFit ( cumlHandle_t  handle,
float *  input,
int  n_rows,
int  n_cols,
float *  labels,
float  C,
float  cache_size,
int  max_iter,
int  nochange_steps,
float  tol,
int  verbosity,
cumlSvmKernelType  kernel,
int  degree,
float  gamma,
float  coef0,
int *  n_support,
float *  b,
float **  dual_coefs,
float **  x_support,
int **  support_idx,
int *  n_classes,
float **  unique_labels 
)

◆ cumlSpSvcPredict()

cumlError_t cumlSpSvcPredict ( cumlHandle_t  handle,
float *  input,
int  n_rows,
int  n_cols,
cumlSvmKernelType  kernel,
int  degree,
float  gamma,
float  coef0,
int  n_support,
float  b,
float *  dual_coefs,
float *  x_support,
int  n_classes,
float *  unique_labels,
float *  preds,
float  buffer_size,
int  predict_class 
)