Description Usage Arguments Details Value Examples
Run a lars/lasso/elasticNet regression
1 |
matX |
A matrix of explanatory variables, i.e. regressors |
vecY |
A vector with the target variable |
lambda1 |
A doube with l1-norm penalty regularization parameter |
lambda2 |
A doube with l2-norm penalty regularization parameter |
useCholesky |
A logical value indicating whether to use the Cholesky |
testX |
A optional matrix of test values to validate prediction decomposition when solving the linear system, else full Gram matrix is used. |
This function performs a lars, lasso or elastic net regression.
A list with estimated coefficient, the value of lambda1 after each iteration and the predicted values, either from the training data or, if supplied, the test set.
1 2 3 4 | ## LARS demo data set from MLPACK with limited rank
data(lars)
fit1 <- LARS(matX = lars_dependent_x, vecY = lars_dependent_y, 0.1, 0.1, FALSE)
fit2 <- LARS(matX = lars_dependent_x, vecY = lars_dependent_y, 0.1, 0.1, TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.