The previous section showed us an example of a classification model using scikit-learn. In this section, we will train a random forest model and use it to make predictions. We will also be building a classification model as the target variable in this scenario. This will be a categorical value that depicts the drinking habits of teenagers.
To do this, we first load the students dataset from the previous chapter. We will then train a logistic regression model and take a look at how to evaluate the classification model at a very basic level.
To begin, we load the libraries and import the students dataset and make some transformations to it, just as we did in the previous section. Our goal is to use the features of the students to predict the level of alcohol. These features are categorical values that can either be high or low. The...