Introduction
While neural networks are often better than linear and logistic regression models at solving regression and classification tasks, respectively, they can be very difficult to interpret. If we wish to test the hypothesis that people drink more water when the temperature rises, it's important that we can extract this information from our model. A neural network with many layers might be very good at predicting the water consumption of a person, based on features such as age, gender, weight, height, humidity, and temperature, but it would be difficult to say how temperature alone affects the prediction. Linear regression would tell us specifically how temperature contributed to the prediction. So, while we might get a worse prediction, we gain an insight into the data and, potentially, the real world. Logistic regression, which we use for binary classification, is similarly easier to interpret.
In this chapter, we will implement and interpret linear and logistic regression models...