How to extract MSEP or RMSEP from lassoCV?

I'm doing lasso and ridge regression in R with the package chemometrics. With ridgeCV it is easy to extract the SEP and MSEP values by modell.ridge$RMSEP and model.ridge$SEP. But how can I do this with lassoCV? model.lasso$SEP works, but there is no RMSE or MSE entry in the list. However the function provides a plot with MSEP and SEP in the legend. Therefore it must be possible to extract both values! But how?

  • SEP = standard error of the predictions;
  • MSEP = mean squared error of the predictions;
  • RMSEP = root mean square error of the predictions = root(MSEP)

Topic mse lasso ridge-regression evaluation r

Category Data Science


Based on the documentation and the source code of the lassocv funtion the SEP values indeed be extracted from the output using $SEP, the MSEP values should be stored in the named list that is returned as $cv:

Value

  • cv - MSEP values at each value of fraction
  • cv.error - standard errors for each value of fraction
  • SEP - SEP value for each value of fraction
  • ind - index of fraction with optimal choice for fraction
  • sopt - optimal value for fraction
  • fraction - all values considered for fraction

To get the RMSEP you can then simply take the square root of the MSEP values.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.