Exploring variable relationships
Exploring the way in which variables move together can help us to determine the hidden patterns that govern the behaviors of our clients:
- Our first step here will be using the Seaborn method to plot some of the relationships, mostly between numerical continuous variables such as tenure, monthly charges, and total charges, using the churn as the
hue
parameter:g = sns.pairplot(data[['tenure','MonthlyCharges', 'TotalCharges','Churn']], hue= "Churn",palette= (["red","blue"]),height=6)
Figure 7.10: Continuous variable relationships
We can observe from the distributions that the customers who churn tend to have a low tenure number, generally having low amounts of monthly charges, as well as having much lower total charges on average.
- Now, we can finally transform and determine the object columns that we will convert into dummies:
object_cols ...