IniziaInizia gratis

Dropping unnecessary features

Some features such as 'Area_Code' and 'Phone' are not useful when it comes to predicting customer churn, and they need to be dropped prior to modeling. The easiest way to do so in Python is using the .drop() method of pandas DataFrames, just as you saw in the video, where 'Soc_Sec' and 'Tax_ID' were dropped:

telco.drop(['Soc_Sec', 'Tax_ID'], axis=1)

Here, axis=1 indicates that you want to drop 'Soc_Sec' and 'Tax_ID' from the columns.

Questo esercizio fa parte del corso

Marketing Analytics: Predicting Customer Churn in Python

Visualizza il corso

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Drop the unnecessary features
telco = ____
Modifica ed esegui il codice