|
Post by Karel on Jun 5, 2016 18:07:35 GMT
I don't get why the cv.glmnet method is used here on the trainingset:
cv.out=cv.glmnet(x[train,],y[train],alpha=0)
As it performs 10-fold CV, I assume it splits up the dataset you give it in 10 folds and then calculates for every lambda the MSE using the 1 fold that was left out (10 times). The lambda that gives the lowest MSE is the best one.
Then refit the model on the full dataset, using the selected lambda.
No?
|
|
|
Post by Unicorn on Jun 6, 2016 12:07:57 GMT
|
|