Session Ready
Exercise

Elastic net regression

You are quickly getting the hang of regularization methods! Let's now apply elastic net, which brings together L1 and L2 regulatization into a single, powerful approach. In a Machine Learning interview, trying out several regularization methods on a given problem speaks loudly of your ability to simplify model complexity and thus help avoid overfitting.

As in the previous exercise, 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 mdlElasticNet using elastic net (method="enet") to predict PlayerValue from all other variables. Explore 8 possible tuning values for each hyperparameter.