In this section, we will look at another linear classifier—logistic regression.
Logistic regression is also referred to as logit models. In this section, we will look at the basic idea of prediction using logistic regression and how to train and use these models. Our applications still involve the Titanic dataset. So, let's get right into it:
- First, we will import all the required functions:
- Then, we're going to load in the dataset:
This results in the following output:
Some further comments about logistic regression—this is something that's not just common in machine learning. It's also a generally popular statistical model for regressions so that you can predict probabilities, so it's no wonder that this type of regression has been around for a long time. It has appeared in fields such as economics and medicine...