Skip to content

Instantly share code, notes, and snippets.

@Haroperi
Created September 5, 2014 06:12
Show Gist options
  • Save Haroperi/afbabc6ad00f9bb99e2d to your computer and use it in GitHub Desktop.
Save Haroperi/afbabc6ad00f9bb99e2d to your computer and use it in GitHub Desktop.
minimal example of lars-lasso regression
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)
@icyee
Copy link

icyee commented Feb 27, 2017

hi, I am wondering how this LARS algorithm could calculate the RMSE ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment