移除不必要的特徵
有些特徵(例如 'Area_Code' 和 'Phone')對預測客戶流失沒有幫助,建模之前需要先移除。在 Python 中,最簡單的方式是使用你在影片中看到的 pandas DataFrame 的 .drop() 方法,當時移除了 'Soc_Sec' 和 'Tax_ID':
telco.drop(['Soc_Sec', 'Tax_ID'], axis=1)
這裡的 axis=1 表示要從欄位中移除 'Soc_Sec' 和 'Tax_ID'。
本練習屬於課程