I would like to apply lars algorithm to some datadset.
First, I fitted the model to the training set and then examined it on test set.
1- After I used cross validation "cv.lars" I dont know how to choose the minimum cross validation error in order to choose best model. while it is clear when I used glmnet by writing in R program cv$lambda.min then after getting the minimum value I fitted the model on this value. So How do I select the minimum value based on cross validation.
coef<- predict(lar, type="coef",s=?? mode="norm",newx=x[testset,])
I want to choose the best value of s (we can also called it $\lambda$) based on cross-validation.
2- I also plotted lars and lasso, but i did not see any differences.
Could you clarify the differences between them please?
3- By using glmnet function, I can plot lambda values on the x-axis. Does this work with lars function?
4-How to calculate the mean squared error on the test set?
Thanks in advance.