Session Ready
Exercise

Lasso regression

Great work applying ridge regression to the fifa19_scaled data! Let's follow a similar approach and apply Lasso regression to the same dataset. As done before, you will create a new column in the coefs data frame with the regression coefficients produced by this regularization method. You will also add another column with the coefficients of the top 5 regressors as determined by Lasso.

To retrieve the coefficients from the caret object, you need to call predict() using the object's finalModel and specify type='coef' and mode='norm', then retain the coefficients column. This will give you a coefficient matrix that can be read in a bottom-up manner: the last row has all variables present whereas the top row has all variables eliminated.

Instructions 1/4
undefined XP
  • 1
  • 2
  • 3
  • 4
  • Create a caret train object named mdlLasso using lasso regression to predict PlayerValue from all other variables in fifa_scaled. Explore 8 possible values for tuning the model hyperparameter.