Telco Customer Churn Prediction
Data Analysis and Deep Learning for Predicting Customer Churn in Telecom
Data Analysis Overview
The Problem: Customer churn is a significant issue for telecom companies, and identifying customers at risk of leaving is essential for improving retention and reducing business losses. The challenge is to predict whether a customer will churn or not based on their demographic and usage data.
Data Preprocessing: The dataset was cleaned and preprocessed before model building. This included:
- Dropping irrelevant columns like `customerID`.
- Handling missing values by filling with the mean or mode of the respective columns.
- Encoding categorical variables using one-hot encoding to convert categorical columns like `gender`, `contract` into numerical representations.
Feature Engineering: We identified the key features that significantly impact churn prediction, such as:
- Contract Type: Customers with month-to-month contracts had a higher likelihood of churn.
- Tenure: Longer-tenured customers are less likely to churn.
- Payment Method: Customers who opted for electronic payment methods exhibited lower churn rates.
Model Building and Evaluation
Two models were trained and evaluated for this task: Neural Networks (NN) and Convolutional Neural Networks (CNN). We performed the following steps:
- Train-Test Split: The dataset was split into training (80%) and testing (20%) sets.
- Model 1 - Neural Network: A simple neural network model with one hidden layer was built using Keras/TensorFlow. The network consisted of 64 neurons in the input layer, 32 neurons in the hidden layer, and a single output neuron for binary classification. The accuracy of the Neural Network model was 78.75%.
- Model 2 - Convolutional Neural Network (CNN): The CNN was implemented by reshaping the data to a 3D input format. The CNN model included a convolutional layer, max-pooling layer, flattening, and dense layers. The CNN model achieved an accuracy of 78.68%.
Model Performance Comparison
| Model | Accuracy (%) | Precision | Recall | F1-Score |
|---|---|---|---|---|
| Neural Network | 78.75 | 0.85 | 0.82 | 0.83 |
| Convolutional Neural Network (CNN) | 78.68 | 0.84 | 0.81 | 0.82 |
Insights and Key Findings
The following insights were derived from the data and model performance:
- Churn is Predictable: The models successfully predicted churn based on customer demographics and usage patterns.
- Model Performance: The Neural Network model marginally outperformed the CNN model, suggesting that fully connected layers were slightly more effective for this tabular data.
- Feature Importance: Features such as contract type, payment method, and tenure were critical in predicting churn, reinforcing their importance in customer retention strategies.
Conclusion & Future Work
Conclusion: This analysis highlights the importance of data preprocessing, feature engineering, and model evaluation in predicting customer churn. The Neural Network model provided slightly better performance than the CNN model.
Future Improvements: Future work could focus on:
- Implementing oversampling techniques like SMOTE to address class imbalance.
- Hyperparameter tuning and exploring more advanced models like XGBoost or Random Forest for improved accuracy.