1. Learn
  2. /
  3. Courses
  4. /
  5. Explainable AI in Python

Connected

Exercise

Computing feature impact with logistic regression

Continuing your work at the insurance company, you built a predictive model to identify whether an individual is a smoker or not. Now, you need to analyze the model to determine the relevant factors influencing smoking status, helping the company assess risk more accurately and tailor insurance policies accordingly.

matplotlib.pyplot has been imported as plt. X_train and y_train are pre-loaded for you.

Instructions

100 XP
  • Extract the coefficients from the model.
  • Plot the coefficients for the given feature_names.