March 2019
Beginner to intermediate
464 pages
10h 57m
English
If you look closely at the data, the following variables are categorical variables:
columns_to_encode = [ 'Sales Channel', 'Vehicle Size', 'Vehicle Class', 'Policy', 'Policy Type', 'EmploymentStatus', 'Marital Status', 'Education', 'Coverage']
These variables have a set of different values they can take and those values do not necessarily have orders that differentiate one from another.
If you recall from Chapter 4, From Engagement to Conversion, there is more than one way to encode categorical variables. In this chapter, the method we are going to use is to create dummy variables for each category of individual categorical variables, using the get_dummies function in the pandas package. Take a look at the following ...
Read now
Unlock full access