Functions
fit an ordinary least squares model

Functions

void ML::GLM::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 ML::GLM::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)
 

Detailed Description

Parameters
inputdevice pointer to feature matrix n_rows x n_cols
n_rowsnumber of rows of the feature matrix
n_colsnumber of columns of the feature matrix
labelsdevice pointer to label vector of length n_rows
coefdevice pointer to hold the solution for weights of size n_cols
intercepthost pointer to hold the solution for bias term of size 1
fit_interceptif true, fit intercept
normalizeif true, normalize data to zero mean, unit variance
algospecifies which solver to use (0: SVD, 1: Eigendecomposition, 2: QR-decomposition)
sample_weightdevice pointer to sample weight vector of length n_rows (nullptr for uniform weights) This vector is modified during the computation

Function Documentation

◆ olsFit() [1/2]

void ML::GLM::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 
)

◆ olsFit() [2/2]

void ML::GLM::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 
)