Exercise

Manual Recursive Feature Elimination

Now that we've created a diabetes classifier, let's see if we can reduce the number of features without hurting the model accuracy too much.

On the second line of code the features are selected from the original DataFrame. Adjust this selection.

A StandardScaler() instance has been predefined as scaler and a LogisticRegression() one as lr.

All necessary functions and packages have been pre-loaded too.

Instructions 1/3

undefined XP
  • 1
    • First, run the given code, then remove the feature with the lowest model coefficient from X.
  • 2
    • Run the code and remove 2 more features with the lowest model coefficients.
  • 3
    • Run the code and only keep the feature with the highest coefficient.