Created
September 5, 2014 06:12
-
-
Save Haroperi/afbabc6ad00f9bb99e2d to your computer and use it in GitHub Desktop.
minimal example of lars-lasso regression
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(lars) | |
y <- iris[,1] | |
x <- iris[,2:4] | |
x <- as.matrix(x) | |
result <- lars(x=x, y=y, type="lasso") | |
coefs <- predict.lars(result, x, type='coefficients') | |
print(coefs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi, I am wondering how this LARS algorithm could calculate the RMSE ?