Predicting Customer Churn.
A machine learning solution designed to predict customer churn and help the marketing team retain at-risk users through personalized offers.
CLIENT:
Interconnect
DATE:
June 03, 2025
PROJECT:
Exploration and Processing
We worked with a dataset of 7,000 users, containing details such as contract type, subscribed services, payment method, billing frequency, and demographic attributes (e.g., couple, dependents, senior citizen). Irrelevant columns including CustomerID, StartDate, EndDate, and Gender were removed to keep only meaningful features.
During preprocessing, we identified rows with missing or whitespace values in TotalCharges and removed them before converting the column to numeric format.
In feature engineering, categorical variables such as Type, PaymentMethod, and InternetService were transformed using One-Hot Encoding, while numerical variables (MonthlyCharges, TotalCharges) were standardized with a StandardScaler. Binary fields were converted from “Yes/No” to 1/0 for consistency.
Because the target variable (churn) was imbalanced — with 73% active users and ~26% churned users — we applied a combination of Random UnderSampling and SMOTE to create a balanced training set.
Model Training and Findings
Three machine learning models were trained and evaluated using pipelines with ColumnTransformer:
- Logistic Regression (baseline)
- Random Forest
- XGBoost
A GridSearchCV was used for hyperparameter tuning, and cross-validation ensured robust performance estimates.
Model performance was assessed using Accuracy and ROC AUC on both training and test sets:
- Logistic Regression → 0.84 / 0.84
- Random Forest → 0.86 / 0.84
- XGBoost → 0.87 / 0.85
All models demonstrated consistent performance between training and testing sets, indicating no overfitting.
The final model selected was XGBoost, achieving the highest ROC AUC score and proving to be the most effective at predicting customer churn with precision.




