Session Ready
Exercise

Creating a LASSO regressor

You'll be working on the numeric ANSUR body measurements dataset to predict a persons Body Mass Index (BMI) using the pre-imported Lasso() regressor. BMI is a metric derived from body height and weight but those two features have been removed from the dataset to give the model a challenge.

You'll standardize the data first using the StandardScaler() that has been instantiated for you as scaler to make sure all coefficients face a comparable regularizing force trying to bring them down.

All necessary functions and classes plus the input datasets X and y have been pre-loaded.

Instructions
100 XP
  • Set the test size to 30% to get a 70-30% train test split.
  • Fit the scaler on the training features and transform these in one go.
  • Create the Lasso model.
  • Fit it to the scaled training data.