February 26, 2026
Customer Churn Prediction in Telecommunications with Machine Learning and Explainable AI
João Carlos Matos Druczkoski; Daniel Alvarez Firmino
Summary prepared by the ResumeAI tool, an artificial intelligence solution developed by Instituto Pecege focused on synthesis and writing.
The objective of this work is to develop a high-performance predictive model for customer churn in the telecommunications sector, translating the findings into strategic recommendations. The specific objectives are: to identify the impact variables; build and compare the performance of machine learning algorithms, including Logistic Regression, Random Forest, XGBoost, and CatBoost; validate the models with classification metrics, focusing on recall; and utilize Explainable Artificial Intelligence (XAI) to extract actionable insights that optimize customer retention. The research thus seeks to create an accurate prediction tool and provide a diagnosis on the factors driving customer loss, enabling proactive actions.
The telecommunications sector operates in an environment of high competitiveness and growing commoditization of services. Companies in the sector depend on maintaining a stable customer base for their business model, based on recurring revenues (Lima and Pamplona, 2010). Customer churn is a critical metric, as the cost of acquiring a new customer (CAC) is significantly higher than retaining an existing one, making loyalty a pillar for business profitability (Hennig-Thurau et al., 2004).
In this scenario, anticipating which customers are at risk of canceling their services represents a competitive advantage. Effective retention is proactive, based on understanding customer needs and satisfaction levels. Factors such as service quality, innovation, and perceived value are crucial for consumer loyalty (Reicheld, 2022). In-depth knowledge of these factors allows telecommunications companies to personalize their offers and communication strategies, increasing the chances of loyalty.
Machine learning emerges as a solution to analyze large volumes of historical data and identify complex patterns associated with churn. Classification algorithms can, with high accuracy, group customers by risk, allowing retention teams to focus their efforts on those most likely to churn. This data-driven approach transforms customer management from a reactive practice to a proactive strategy, optimizing resource allocation.
This study proposes a churn prediction system that combines high predictive performance with interpretability. The use of advanced classification algorithms and the SHAP (Shapley Additive Explanations) methodology allows not only to predict “who” will churn, but also to understand “why”. This diagnostic capability enables the development of targeted interventions, such as personalized marketing campaigns, discount offers, or improvements in specific services, with the aim of strengthening customer relationships and reducing the churn rate.
The research adopts a quantitative approach, applying machine learning techniques to develop a binary classification model. The study followed the phases of the CRISP-DM methodology (Chapman et al., 2000). The database used is a public dataset from IBM, with anonymized information of 7,043 customers of a telecommunications company in California, collected in the third quarter of 2018 (IBM, 2017). The dataset consists of 21 variables, including demographic data, contractual data, service data, and the target variable, which indicates whether the customer churned.
For the modeling, four algorithms were selected. Logistic Regression was chosen as the baseline due to its simplicity and interpretability (Boateng and Abaye, 2019). Ensemble models, such as Random Forest, were explored for their robustness and ability to reduce overfitting (Breiman, 2001). Additionally, two Gradient Boosting algorithms were tested: XGBoost, known for its speed (Chen and Guestrin, 2016), and CatBoost, designed to efficiently handle categorical variables and often demonstrating superior performance (Prokhorenkova et al., 2018). The literature indicates that ensemble models based on boosting are effective for churn prediction due to their ability to handle class imbalance and complex interactions (Imani, 2024).
Hyperparameter optimization was performed using a hybrid strategy to maximize the model’s predictive potential. Initially, Random Search was employed to efficiently explore a vast space of values (Bergstra and Bengio, 2012). Subsequently, Grid Search was applied to refine the search in promising regions, exhaustively evaluating a focused set of combinations. This approach balances exploration and refinement, increasing the probability of finding a configuration close to the global optimum (Wang and Gadi, 2024).
To ensure that the results were comprehensible and actionable, the XAI technique known as SHAP (Shapley Additive Explanations) was applied. Based on game theory, the SHAP methodology calculates the contribution of each variable to each individual prediction, allowing for a detailed analysis of how the model makes its decisions (Lundberg and Lee, 2017). This step was crucial for translating the patterns identified by the algorithm into strategic insights, identifying the main risk and retention factors. Model evaluation was performed using metrics such as Accuracy, Precision, Recall, F1-Score, and the area under the ROC curve (AUC-ROC), ensuring a comprehensive performance analysis.
The exploratory data analysis revealed that the overall churn rate in the base was 26.5%. Data preparation included converting the TotalCharges variable to a numeric format, which revealed 11 null values, which were removed. The analysis of numerical variables showed that tenure and TotalCharges had a high correlation, with a Variance Inflation Factor (VIF) of 9.53 for TotalCharges. To avoid multicollinearity, the TotalCharges variable was excluded from modeling.
The investigation of the relationship between the variables and churn revealed that most cancellations occur in the first months of the contract, suggesting flaws in the onboarding process. Another finding was the greater propensity to churn among elderly customers (SeniorCitizen), which may indicate barriers of technical complexity. Customers with fiber optic internet (Fiber optic) showed a churn rate of 41.89%, signaling possible quality or pricing issues with this service.
The analysis of categorical variables deepened the understanding of risk factors. Contract type (Contract) emerged as one of the strongest predictors: customers with monthly contracts (Month-to-month) had a churn rate of 42.71%, while those with two-year contracts (Two year) presented a rate of only 2.85%. Payment method by electronic check (Electronic check) was associated with a churn rate of 45.29%, much higher than automatic methods such as bank transfer (16.73%) or credit card (15.25%). The absence of services like online security (OnlineSecurity) and technical support (TechSupport) was also correlated with higher cancellation rates.
The combination of characteristics allowed the identification of extremely high-risk segments. New customers (tenure of up to 3 months) without the online security service presented a churn rate of 71.1%. The segment of customers with a monthly contract and fiber optic internet had a rate of 54.6%. Elderly customers without technical support canceled the service in 50.6% of cases. Finally, customers who used electronic checks and had monthly charges exceeding 75 dollars had a churn rate of 49.3%. These segments represent priority targets for retention actions.
The modeling process began with the final data preparation. After removing the CustomerID and TotalCharges columns, categorical variables were transformed using One-Hot Encoding. The database was divided into training (70%) and testing (30%) sets in a stratified manner. The numerical variables tenure and MonthlyCharges were standardized using StandardScaler to adjust their distribution to a mean of zero and a standard deviation of one.
In the first evaluation phase, the four algorithms were trained with default settings and 5-fold cross-validation. To address class imbalance (26.5% churn), an algorithm-level weighting strategy was applied. Logistic Regression achieved an average recall of 78.59%, with a precision of 52.19%. Random Forest had a modest performance, with a recall of 49.24%. The boosting models, XGBoost and CatBoost, presented balanced performance, with CatBoost standing out with a recall of 77.82%, F1-Score of 62.89%, and AUC of 0.85. Considering the objective of maximizing recall and its superior performance in balance metrics, CatBoost was selected for the optimization step.
The CatBoost model underwent a two-stage hyperparameter optimization (Random Search and Grid Search) to maximize the F1-Score. The final model, with optimized hyperparameters, demonstrated incremental gains: recall increased from 79% to 80%, precision rose from 51% to 52%, and the F1-Score improved from 62% to 63%. Although marginal, these gains are relevant in the business context, as a 1% increase in recall can translate into retaining thousands of subscribers. The AUC value remained at 0.85, indicating that the optimization refined the balance between precision and recall. These results align with the literature, which reports recall values between 70% and 85% for telecommunications churn models (Barsotti et al., 2024).
The final stage consisted of the interpretation of the optimized model using SHAP. The analysis revealed that the variables with the greatest impact on churn prediction were, in order: Contract, tenure, and InternetService. SHAP dependency plots showed that monthly contracts (Month-to-month) drastically increase the prediction towards churn, while two-year contracts (Two year) act as a retention factor. The tenure variable showed that the risk of churn is very high in the first few months and decreases continuously, becoming a protective factor after approximately 20 months. For internet service, fiber optic (Fiber optic) was the main driver of churn, while the absence of services such as OnlineSecurity and TechSupport also contributed to the risk. Based on these findings, recommendations were formulated, such as the implementation of an onboarding program, incentives for migration to long-term contracts, investigation of problems with fiber optic service, and promotion of cross-selling of security and support services.
The present work developed a high-performance model for churn prediction, achieving the proposed objective. Through the CatBoost algorithm and a rigorous optimization process, a predictive model was built capable of identifying customers prone to canceling the service with a recall of 80%. The use of XAI techniques, such as SHAP, allowed for the unveiling of the determining factors behind the predictions, transforming the model into a diagnostic tool. The analysis revealed that adherence to monthly contracts, low tenure, and the acquisition of fiber optic internet are the main drivers of churn. In contrast, long-term contracts and the acquisition of additional security and support services emerged as strong indicators of retention. The findings provide actionable direction for management, indicating the need for actions focused on migrating to long-term contracts, improving the initial customer experience, and investigating possible operational failures or perception of value in specific services. The implementation of these actions has the potential to reduce the churn rate and strengthen the company’s competitive position. The main limitation of the study lies in the use of a public database, which may not capture all the nuances of the Brazilian market. It is concluded that the objective was achieved: it was demonstrated that it is possible to develop a high-performance machine learning model to predict customer churn and identify its main determinants, providing a robust tool for the creation of proactive retention strategies.
References:
Barsotti, A.; Gianini, G.; Mio, C.; Cabitza, F.; Campagner, A. 2024. A decade of churn prediction techniques in the TelCo domain: a survey. SN Computer Science 5: 404.
Bergstra, J.; Bengio, Y. 2012. Random search for hyper-parameter optimization. Journal of Machine Learning Research 13:281-305.
Boateng, E. Y.; Abaye, D. A. 2019. A review of the logistic regression model with emphasis on medical research. Journal of Data Analysis and Information Processing 7(4):190-207.
Boehmke, B.; Greenwell, B. 2019. Hands-On Machine Learning with R. Chapman and Hall/CRC, New York, NY, USA.
Breiman, L. 2001. Random forests. Machine Learning 45(1):5-32.
Chapman, P.; Clinton, J.; Kerber, R.; Khabaza, T.; Reinartz, T.; Shearer, C.; Wirth, R. 2000. CRISP-DM 1.0: Step-by-Step Data Mining Guide. SPSS Inc, Chicago, IL, USA.
Chen, T.; Guestrin, C. 2016. Xgboost: A scalable tree boosting system. In: 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2016, San Francisco, CA, USA. Proceedings… p. 785-794.
Hennig-Thurau, T.; Gwinner, K. P.; Walsh, G.; Gremler, D. D. 2004. Electronic word-of-mouth via consumer-opinion platforms: What motivates consumers to articulate themselves on the internet. Journal of Interactive Marketing 18(1):38-52.
IBM. 2017. Telco Customer Churn. Available at: <https://www. kaggle. com/datasets/blastchar/telco-customer-churn>. Accessed on: May 21, 2025.
Imani, M. 2024. Customer Churn Prediction in Telecommunication Industry: A Literature Review. Available at: <https://www. preprints. org/manuscript/202403.0585/v3>. Accessed on: May 21, 2025.
Lima, K.; Pamplona, N. 2010. Brazil’s contribution goes beyond the sector of telecommunications. Estadão. Available at: <https://www. estadao. com. br/economia/contribuicao-do-brasil-vai-alem-do-setor-de-telecom-imp-/>. Accessed on: May 21, 2025.
Lundberg, S. M.; Lee, S. I. 2017. A unified approach to interpreting model predictions. In: Conference on Neural Information Processing Systems, 2017, Long Beach, CA, USA. Proceedings… p. 4765-4774.
Prokhorenkova, L.; Gusev, G.; Vorobev, A.; Dorogush, A. V.; Gulin, A. 2018. CatBoost: unbiased boosting with categorical features. In: Conference on Neural Information Processing Systems, 2018, Montréal, Canada. Proceedings… p. 6638-6647.
Reicheld, F. 2022. Winning with Purpose. Benvirá Publishing House, São José dos Campos, SP, Brazil.
Ul Hassan, C. A.; Khan, M. S.; Shah, M. A. 2018. Comparison of machine learning algorithms in data classification. In: 24th International Conference on Automation and Computing (ICAC), 2018, Newcastle upon Tyne, UK. Proceedings… p. 1-6.
Wang, Z.; Gadi, M. 2024. Optimal HVAC setpoints for energy efficiency and thermal comfort in Chinese residential buildings. Journal of Building Engineering 96:107626.
Executive summary from the Final Course Work of the Specialization in Data Science and Analytics of the MBA USP/Esalq
Learn more about the course; click here: