Namespaces | Functions
ML::GLM Namespace Reference

Namespaces

 opg
 

Functions

void olsFit (const raft::handle_t &handle, float *input, size_t n_rows, size_t n_cols, float *labels, float *coef, float *intercept, bool fit_intercept, bool normalize, int algo=0, float *sample_weight=nullptr)
 
void olsFit (const raft::handle_t &handle, double *input, size_t n_rows, size_t n_cols, double *labels, double *coef, double *intercept, bool fit_intercept, bool normalize, int algo=0, double *sample_weight=nullptr)
 
void ridgeFit (const raft::handle_t &handle, float *input, size_t n_rows, size_t n_cols, float *labels, float *alpha, int n_alpha, float *coef, float *intercept, bool fit_intercept, bool normalize, int algo=0, float *sample_weight=nullptr)
 
void ridgeFit (const raft::handle_t &handle, double *input, size_t n_rows, size_t n_cols, double *labels, double *alpha, int n_alpha, double *coef, double *intercept, bool fit_intercept, bool normalize, int algo=0, double *sample_weight=nullptr)
 
void gemmPredict (const raft::handle_t &handle, const float *input, size_t n_rows, size_t n_cols, const float *coef, float intercept, float *preds)
 
void gemmPredict (const raft::handle_t &handle, const double *input, size_t n_rows, size_t n_cols, const double *coef, double intercept, double *preds)
 
template<typename T , typename I = int>
void qnFit (const raft::handle_t &cuml_handle, const qn_params &params, T *X, bool X_col_major, T *y, I N, I D, I C, T *w0, T *f, int *num_iters, T *sample_weight=nullptr, T svr_eps=0)
 Fit a GLM using quasi newton methods. More...
 
template<typename T , typename I = int>
void qnFitSparse (const raft::handle_t &cuml_handle, const qn_params &params, T *X_values, I *X_cols, I *X_row_ids, I X_nnz, T *y, I N, I D, I C, T *w0, T *f, int *num_iters, T *sample_weight=nullptr, T svr_eps=0)
 Fit a GLM using quasi newton methods. More...
 
template<typename T , typename I = int>
void qnDecisionFunction (const raft::handle_t &cuml_handle, const qn_params &params, T *X, bool X_col_major, I N, I D, I C, T *coefs, T *scores)
 Obtain the confidence scores of samples. More...
 
template<typename T , typename I = int>
void qnDecisionFunctionSparse (const raft::handle_t &cuml_handle, const qn_params &params, T *X_values, I *X_cols, I *X_row_ids, I X_nnz, I N, I D, I C, T *coefs, T *scores)
 Obtain the confidence scores of samples. More...
 
template<typename T , typename I = int>
void qnPredict (const raft::handle_t &cuml_handle, const qn_params &params, T *X, bool X_col_major, I N, I D, I C, T *coefs, T *preds)
 Predict a GLM using quasi newton methods. More...
 
template<typename T , typename I = int>
void qnPredictSparse (const raft::handle_t &cuml_handle, const qn_params &params, T *X_values, I *X_cols, I *X_row_ids, I X_nnz, I N, I D, I C, T *coefs, T *preds)
 Predict a GLM using quasi newton methods. More...
 
cumlError_t cumlSpQnFit (cumlHandle_t cuml_handle, const qn_params *pams, float *X, float *y, int N, int D, int C, float *w0, float *f, int *num_iters, bool X_col_major)
 
cumlError_t cumlDpQnFit (cumlHandle_t cuml_handle, const qn_params *pams, double *X, double *y, int N, int D, int C, double *w0, double *f, int *num_iters, bool X_col_major)
 

Function Documentation

◆ cumlDpQnFit()

cumlError_t ML::GLM::cumlDpQnFit ( cumlHandle_t  cuml_handle,
const qn_params pams,
double *  X,
double *  y,
int  N,
int  D,
int  C,
double *  w0,
double *  f,
int *  num_iters,
bool  X_col_major 
)

◆ cumlSpQnFit()

cumlError_t ML::GLM::cumlSpQnFit ( cumlHandle_t  cuml_handle,
const qn_params pams,
float *  X,
float *  y,
int  N,
int  D,
int  C,
float *  w0,
float *  f,
int *  num_iters,
bool  X_col_major 
)

◆ qnDecisionFunction()

template<typename T , typename I = int>
void ML::GLM::qnDecisionFunction ( const raft::handle_t &  cuml_handle,
const qn_params params,
T *  X,
bool  X_col_major,
N,
D,
C,
T *  coefs,
T *  scores 
)

Obtain the confidence scores of samples.

Parameters
cuml_handlereference to raft::handle_t object
paramsmodel parameters
Xdevice pointer to a contiguous feature matrix of dimension [N, D]
X_col_majortrue if X is stored column-major
Nnumber of examples
Dnumber of features
Cnumber of outputs (number of classes or 1 for regression)
coefsdevice pointer to model coefficients. Length D if fit_intercept == false else D+1
scoresdevice pointer to confidence scores of length N (for binary logistic: [0,1], for multinomial: [0,...,C-1])

◆ qnDecisionFunctionSparse()

template<typename T , typename I = int>
void ML::GLM::qnDecisionFunctionSparse ( const raft::handle_t &  cuml_handle,
const qn_params params,
T *  X_values,
I *  X_cols,
I *  X_row_ids,
X_nnz,
N,
D,
C,
T *  coefs,
T *  scores 
)

Obtain the confidence scores of samples.

Parameters
cuml_handlereference to raft::handle_t object
paramsmodel parameters
X_valuesfeature matrix values (CSR format), length = X_nnz
X_colsfeature matrix columns (CSR format), length = X_nnz, range = [0, ... D-1]
X_row_idsfeature matrix compressed row ids (CSR format), length = N + 1, range = [0, ... X_nnz]
X_nnznumber of non-zero entries in the feature matrix (CSR format)
Nnumber of examples
Dnumber of features
Cnumber of outputs (number of classes or 1 for regression)
coefsdevice pointer to model coefficients. Length D if fit_intercept == false else D+1
scoresdevice pointer to confidence scores of length N (for binary logistic: [0,1], for multinomial: [0,...,C-1])

◆ qnFit()

template<typename T , typename I = int>
void ML::GLM::qnFit ( const raft::handle_t &  cuml_handle,
const qn_params params,
T *  X,
bool  X_col_major,
T *  y,
N,
D,
C,
T *  w0,
T *  f,
int *  num_iters,
T *  sample_weight = nullptr,
svr_eps = 0 
)

Fit a GLM using quasi newton methods.

Parameters
cuml_handlereference to raft::handle_t object
paramsmodel parameters
Xdevice pointer to a contiguous feature matrix of dimension [N, D]
X_col_majortrue if X is stored column-major
ydevice pointer to label vector of length N
Nnumber of examples
Dnumber of features
Cnumber of outputs (number of classes or 1 for regression)
w0device pointer of size (D + (fit_intercept ? 1 : 0)) * C with initial point, overwritten by final result.
fhost pointer holding the final objective value
num_itershost pointer holding the actual number of iterations taken
sample_weightdevice pointer to sample weight vector of length n_rows (nullptr for uniform weights)
svr_epsepsilon parameter for svr

◆ qnFitSparse()

template<typename T , typename I = int>
void ML::GLM::qnFitSparse ( const raft::handle_t &  cuml_handle,
const qn_params params,
T *  X_values,
I *  X_cols,
I *  X_row_ids,
X_nnz,
T *  y,
N,
D,
C,
T *  w0,
T *  f,
int *  num_iters,
T *  sample_weight = nullptr,
svr_eps = 0 
)

Fit a GLM using quasi newton methods.

Parameters
cuml_handlereference to raft::handle_t object
paramsmodel parameters
X_valuesfeature matrix values (CSR format), length = X_nnz
X_colsfeature matrix columns (CSR format), length = X_nnz, range = [0, ... D-1]
X_row_idsfeature matrix compressed row ids (CSR format), length = N + 1, range = [0, ... X_nnz]
X_nnznumber of non-zero entries in the feature matrix (CSR format)
ydevice pointer to label vector of length N
Nnumber of examples
Dnumber of features
Cnumber of outputs (number of classes or 1 for regression)
w0device pointer of size (D + (fit_intercept ? 1 : 0)) * C with initial point, overwritten by final result.
fhost pointer holding the final objective value
num_itershost pointer holding the actual number of iterations taken
sample_weightdevice pointer to sample weight vector of length n_rows (nullptr for uniform weights)
svr_epsepsilon parameter for svr

◆ qnPredict()

template<typename T , typename I = int>
void ML::GLM::qnPredict ( const raft::handle_t &  cuml_handle,
const qn_params params,
T *  X,
bool  X_col_major,
N,
D,
C,
T *  coefs,
T *  preds 
)

Predict a GLM using quasi newton methods.

Parameters
cuml_handlereference to raft::handle_t object
paramsmodel parameters
Xdevice pointer to a contiguous feature matrix of dimension [N, D]
X_col_majortrue if X is stored column-major
Nnumber of examples
Dnumber of features
Cnumber of outputs (number of classes or 1 for regression)
coefsdevice pointer to model coefficients. Length D if fit_intercept == false else D+1
predsdevice pointer to predictions of length N (for binary logistic: [0,1], for multinomial: [0,...,C-1])

◆ qnPredictSparse()

template<typename T , typename I = int>
void ML::GLM::qnPredictSparse ( const raft::handle_t &  cuml_handle,
const qn_params params,
T *  X_values,
I *  X_cols,
I *  X_row_ids,
X_nnz,
N,
D,
C,
T *  coefs,
T *  preds 
)

Predict a GLM using quasi newton methods.

Parameters
cuml_handlereference to raft::handle_t object
paramsmodel parameters
X_valuesfeature matrix values (CSR format), length = X_nnz
X_colsfeature matrix columns (CSR format), length = X_nnz, range = [0, ... D-1]
X_row_idsfeature matrix compressed row ids (CSR format), length = N + 1, range = [0, ... X_nnz]
X_nnznumber of non-zero entries in the feature matrix (CSR format)
Nnumber of examples
Dnumber of features
Cnumber of outputs (number of classes or 1 for regression)
coefsdevice pointer to model coefficients. Length D if fit_intercept == false else D+1
predsdevice pointer to predictions of length N (for binary logistic: [0,1], for multinomial: [0,...,C-1])