Session Ready
Exercise

Multivariate logistic regression

Generally, you won't use only loan_int_rate to predict the probability of default. You will want to use all the data you have to make predictions.

With this in mind, try training a new model with different columns, called features, from the cr_loan_clean data. Will this model differ from the first one? For this, you can easily check the .intercept_ of the logistic regression. Remember that this is the y-intercept of the function and the overall log-odds of non-default.

The cr_loan_clean data has been loaded in the workspace along with the previous model clf_logistic_single.

Instructions
100 XP
  • Create a new X data set with loan_int_rate and person_emp_length. Store it as X_multi.
  • Create a y data set with just loan_status.
  • Create and .fit() a LogisticRegression() model on the new X data. Store it as clf_logistic_multi.
  • Print the .intercept_ value of the model