Making more discriminative models
In the previous exercise, the range for predicted probabilities of default was rather small. As discussed, small predicted default probabilities are to be expected with low default rates, but building bigger models (which basically means: including more predictors) can expand the range of your predictions.
Whether this will eventually lead to better predictions still needs to be validated and depends on the quality of the newly included predictors. But first, have a look at how bigger models can expand the range.
Deze oefening maakt deel uit van de cursus
Credit Risk Modeling in R
Oefeninstructies
- Make
log_model_fulllike the way you madelog_model_small, but this time, include all available predictors in the data set. If you don't want to type the name of every column separately, you can simply select all variables usingloan_status ~ . - Create your prediction vector
predictions_all_fullfor all the cases in the test set usingpredict(). Notice that these values represent the probability of defaulting. - Look at the range of the predictions.
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
# Change the code below to construct a logistic regression model using all available predictors in the data set
log_model_small <- glm(loan_status ~ age + ir_cat, family = "binomial", data = training_set)
# Make PD-predictions for all test set elements using the the full logistic regression model
# Look at the predictions range