Functions | |
| template<typename math_t , typename idx_t > | |
| void | larsFit (const raft::handle_t &handle, math_t *X, idx_t n_rows, idx_t n_cols, const math_t *y, math_t *beta, idx_t *active_idx, math_t *alphas, idx_t *n_active, math_t *Gram, int max_iter, math_t *coef_path, rapids_logger::level_enum verbosity, idx_t ld_X, idx_t ld_G, math_t eps) |
| Train a regressor using LARS method. More... | |
| template<typename math_t , typename idx_t > | |
| void | larsPredict (const raft::handle_t &handle, const math_t *X, idx_t n_rows, idx_t n_cols, idx_t ld_X, const math_t *beta, idx_t n_active, idx_t *active_idx, math_t intercept, math_t *preds) |
| Predict with LARS regressor. More... | |
| void ML::Solver::Lars::larsFit | ( | const raft::handle_t & | handle, |
| math_t * | X, | ||
| idx_t | n_rows, | ||
| idx_t | n_cols, | ||
| const math_t * | y, | ||
| math_t * | beta, | ||
| idx_t * | active_idx, | ||
| math_t * | alphas, | ||
| idx_t * | n_active, | ||
| math_t * | Gram, | ||
| int | max_iter, | ||
| math_t * | coef_path, | ||
| rapids_logger::level_enum | verbosity, | ||
| idx_t | ld_X, | ||
| idx_t | ld_G, | ||
| math_t | eps | ||
| ) |
Train a regressor using LARS method.
| handle | RAFT handle |
| X | device array of training vectors in column major format, size [n_rows * n_cols]. Note that the columns of X will be permuted if the Gram matrix is not specified. It is expected that X is normalized so that each column has zero mean and unit variance. |
| n_rows | number of training samples |
| n_cols | number of feature columns |
| y | device array of the regression targets, size [n_rows]. y should be normalized to have zero mean. |
| beta | device array of regression coefficients, has to be allocated on entry, size [max_iter] |
| active_idx | device array containing the indices of active variables. Must be allocated on entry. Size [max_iter] |
| alphas | the maximum correlation along the regularization path are returned here. Must be a device array allocated on entry Size [max_iter]. |
| n_active | host pointer to return the number of active elements, scalar. |
| Gram | device array containing Gram matrix (X.T * X). Can be nullptr. Size [n_cols * ld_G] |
| max_iter | maximum number of iterations, this equals with the maximum number of coefficients returned. max_iter <= n_cols. |
| coef_path | coefficients along the regularization path are returned here. Must be nullptr, or a device array already allocated on entry. Size [max_iter * max_iter]. |
| verbosity | verbosity level |
| ld_X | leading dimension of X (stride of columns, ld_X >= n_rows). |
| ld_G | leading dimesion of G (ld_G >= n_cols) |
| eps | numeric parameter for Cholesky rank one update |
| void ML::Solver::Lars::larsPredict | ( | const raft::handle_t & | handle, |
| const math_t * | X, | ||
| idx_t | n_rows, | ||
| idx_t | n_cols, | ||
| idx_t | ld_X, | ||
| const math_t * | beta, | ||
| idx_t | n_active, | ||
| idx_t * | active_idx, | ||
| math_t | intercept, | ||
| math_t * | preds | ||
| ) |
Predict with LARS regressor.
| handle | RAFT handle |
| X | device array of training vectors in column major format, size [n_rows * n_cols]. |
| n_rows | number of training samples |
| n_cols | number of feature columns |
| ld_X | leading dimension of X (stride of columns) |
| beta | device array of regression coefficients, size [n_active] |
| n_active | the number of regression coefficients |
| active_idx | device array containing the indices of active variables. Only these columns of X will be used for prediction, size [n_active]. |
| intercept | |
| preds | device array to store the predictions, size [n_rows]. Must be allocated on entry. |