7. Supervised Learning: Predicting Customer Churn
Activity 7.01: Performing the OSE technique from OSEMN
Solution:
- Import the necessary libraries:
# Removes Warnings
import warnings
warnings.filterwarnings('ignore')
#import the necessary packages
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
- Download the dataset from https://packt.link/80blQ and save it as Telco_Churn_Data.csv. Make sure to run the notebook from the same folder as the dataset.
- Create a DataFrame called data and read the dataset using pandas' read.csv method. Look at the first few rows of the DataFrame:
data= pd.read_csv(r'Telco_Churn_Data.csv')
data.head(5)
Note
Make sure you change the path (emboldened in the preceding code snippet) to the CSV file based on its location on your system. If you're running the Jupyter notebook from the same directory where the CSV file is stored, you can run the preceding code without any modification.
The...