Comparing logistic regression with linear regression
In this section, we will focus on a binary credit classification task using the German Credit dataset, which contains 1,000 observations and 20 columns. Each observation denotes a customer who had a loan application from the bank and is labeled as either good or bad in terms of credit risk. The dataset is available in the caret
package in R.
For our study, we will attempt to predict the target binary variable, Class
, based on Duration
, and compare the difference in the prediction outcome between linear regression and logistic regression. We specifically choose one predictor only so that we can visualize and compare the decision boundaries of the resultant model in a two-dimensional plot.
Exercise 13.1 – comparing linear regression with logistic regression
In this exercise, we will demonstrate the advantage of using a logistic regression model in producing a probabilistic output compared to the unbounded output using...