Coding Challenge: Preprocessing

Practice preprocessing data with scikit-learn.

Now we’ll work with a dataset containing information about a bank’s customer base, featuring the following variables:

  • customerID: The customer’s unique ID.

  • gender: The customer’s gender.

  • SeniorCitizen: The customer’s senior citizen status.

  • Partner: The customer’s relationship status.

  • Dependents: The customer’s number of dependents?

  • tenure: The length of time (in months) the the individual has been a customer.

  • Services that the customer has subscribed to:

    • PhoneService

    • MultipleLines

    • InternetService

    • OnlineSecurity

    • OnlineBackup

    • DeviceProtection

    • TechSupport

    • StreamingTV

    • StreamingMovies

  • Contract: The customer’s current contract type: “Month-to-Month,” “One Year,” “Two Year.”

  • PaperlessBilling: The customer’s preference regarding paperless billing.

  • PaymentMethod: The customer’s preferred method of bank payment: bank withdrawal, credit card, mailed check.

  • MonthlyCharges: The customer’s current total monthly charge.

  • TotalCharges: The customer’s total charges.

  • Churn: Whether or not the customer has exited or churned (our target variable).

Here’s an example of how it looks:

Get hands-on with 1400+ tech skills courses.