1. 学习
  2. /
  3. 课程
  4. /
  5. Marketing Analytics: Predicting Customer Churn in Python

Connected

练习

One hot encoding

In the video, you saw how the 'State' feature can be encoded numerically using the technique of one hot encoding:

ohe_part3.png

Doing this manually would be quite tedious, especially when you have 50 states and over 3000 customers! Fortunately, pandas has a get_dummies() function which automatically applies one hot encoding over the selected feature.

说明 1 / 共 2 个

undefined XP
    1
    2
  • Use the pd.get_dummies() function to apply one hot encoding on the 'State' feature of telco.