Session Ready
Exercise

Visualizing column importance

When the model is trained on different sets of columns it changes the performance, but does the importance for the same column change depending on which group it's in?

The data sets X2 and X3 have been created with the following code:

X2 = cr_loan_prep[['loan_int_rate','person_emp_length']]
X3 = cr_loan_prep[['person_income','loan_int_rate','loan_percent_income']]

Understanding how different columns are used to arrive at a loan_status prediction is very important for model interpretability.

The data sets cr_loan_prep, X2_train, X2_test, X3_train, X3_test, y_train, y_test are loaded in the workspace.

Instructions 1/2
undefined XP
  • 1
  • 2
  • Create and train a XGBClassifier() model on X2_train and call it clf_gbt2.
  • Plot the column importances for the columns that clf_gbt2 trained on.