Detecting Churn In Telecom Industry Using Machine Learning

Methodology and Results

Customer churn is referred as the un-subscription of a product or service by customers for a particular brand or company and accepting same product or service from another company. Hence, churning customers are not good for any business as it shows customers are not satisfied with the product or service of the current company and thus are forced to associate with a different brand of same industry. Churning reduces the brand trust in new customers also as they are influenced by the comments and activities of old customers who have stopped using company services or products. Hence, every brand needs to investigate the reason of churn and more importantly target the customers who are likely to churn with attractive offers or other strategies to keep those customers associated with company. This is important as it is relatively easy to maintain existing customers than to acquire new customers in terms cost of business promotion and involvement of company resources. Hence, like any other sector in telecommunication sector it is important to know which customers are churning and predicting who are likely to churn based on analysis for targeted retention planning of customers which will make the business sustainable in the long run (Ahmad, Jafar & Aljoumaa, 2019). Now, analysis of customer can be done manually by inspecting customer data thoroughly and then deciding the critical factors that influences customer churn, however, this method is very time consuming and thus inefficient for analyzing large customer bases of the telecom company. Hence, machine learning solution to automatically detect the customers who are likely to churn are much recommended as the process is fast and when ML algorithm is well trained then good accuracy can be produced (Jain, Khunteta & Srivastava, 2021). In this research using a sample customer churn dataset obtained from Kaggle repository a decision tree model is built which is evaluated on a small section of the dataset and performance of the algorithm is assessed and more over the important attributes that are related with churn are found. The dataset contains a total of 21 attributes of 7043 customers of the telecom industry and last column of the dataset is the Churn column with binary values Yes or No for churning and non-churning customers (“Telco Customer Churn”, 2022). Some attributes are removed from dataset before doing analysis and fitting model which is described in details in the later section. The dataset is saved in an online MongoDB platform and then retrieved from it in google Colab, where the entire pre-processing and model fitting is performed with necessary python coding utilizing Pyspark MLlib, matplotlib, pandas, NumPy, sci-kit learn modules.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Handling of Missing Values

After loading the dataset in Colab as per instruction the attributes MonthlyCharges, OnlineSecurity, StreamingTV, InternetService and Partner are removed and analysis and model fitting is performed with the modified version of data. Additionally, the customer ID is not a feature and assumed to have no influence in determining the class and thus removed from the dataset.

In the pre-processing the missing values are investigated and no missing instances are found. However, in the attributes TotalCharges some invalid values are found which are coerced by NAN by pandas numeric conversion method and then those instances are imputed with mean of valid values of the attribute (Raja and Thangavel, 2020). This reserves all instances of the loaded dataset.

There are three numeric variables in the dataset for which the descriptive statistics are computed as given below.

 

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

It can be seen that the on an average most of the customer are not senior citizen, the average tenure of customers are about 32 months and average total amount charged to customer is about €2283 (Betancourt and Chen, 2019).

Now, the categorical features are analyzed displaying the frequency of categories in bar charts and it is found that only gender distribution is uniform while the distribution of other categorical features are imbalanced.

 

The class variable churn shows that there are high number of non-churning customers in the dataset that the churning customers in the collected sample. Hence, assuming the sample represents the entire customer base of the telecom company, it can be seen that company is able hold a large proportion of customers and only some customers are churning which are needed to be identified by ML methods.

Now, the categorical features are one-hot encoded for fitting the model and then appended with the numeric features to create a features column containing values of all features and then features class label are extracted to fit the decision tree model (Seger, 2018). However, before that the train-test splitting of the selected features and columns are performed in 80:20 ratio with a specific random state for reproducibility of splitting. The decision is model with maximum depth of 3 is then fitted to the train set and then used for prediction in the test set (Nokeri, 2022).

First 10 rows of prediction along with gender and senior citizen attribute values:

 

Evaluation results in test set:

 

Hence, it can be seen that developed decision tree model correctly predicted more non-churning customers than churning customers and thus accuracy of model is observed to be about 79.38% and f1, recall and precision scores are also enough high (Thambawita et al., 2020). Hence, the results of fitted decision tree model for churn detection can be considered satisfactory.

Statistical Analysis of Attributes

Now, the importance scores of features are gathered from decision tree as given below.

 

It can be seen that contract with month-to-month category, tech support with No category and tenure has some significant positive importance scores and for the rest the scores are close to zero and thus are not important. Now, the most important feature contract has no missing instances and missing value replacement is not required (Raff, Sylvester & Mills, 2018). Now, to find the insights about customers who are churning the churn attribute is plotted against these three in three different plots.

 

It is clearly observed that churning customers are the ones who are in month-to-month contract basis as from the bar plot the count for same are significantly higher than one-year or two-year contract (Pajankar, 2022).

 

Hence, the churning customers are the ones who does not need tech support from company as the count for the same is significantly higher than churn count for customers who does not have internet or those who needs support (Pajankar, 2022).

 

It is observed that most of the customers who are churning have tenure mostly under 30 months whereas significant percentage of non-churning customers have tenure over 30 months which goes over 70 months (Pajankar, 2022). There are very few churning customers who have tenure over 30 months.

Conclusion:

Hence, in conclusion it can be stated that decision tree model is developed using necessary machine learning techniques in python with built-in libraries and model shows good performance to detect churn and non-churning customers based on their historical attributes. The number of missing values in dataset is very small which is observed in total charges attribute only and thus a different imputation or removal is unlikely to improve model performance significantly. However, a different types of pre-processing like normalization of attributes or feature selection by some algorithm like L1 or L2 based SVM feature selector or tree-based feature selection methods can improve the accuracy of model and thus overall churn analysis in a significant way which is left to be investigated as a future scope of this research. The churning customers are mainly found to be under 30 months tenure, requires no technical support and are on month-to-month contract basis and thus telecom company needs to target customers with these attributes and develop suitable strategies (like giving new exciting offers, promotional phone calling) to retain this segment of customers.

References:

Ahmad, A. K., Jafar, A., & Aljoumaa, K. (2019). Customer churn prediction in telecom using machine learning in big data platform. Journal of Big Data, 6(1), 1-24.

Betancourt, R., & Chen, S. (2019). pandas Library. In Python for SAS Users (pp. 65-109). Apress, Berkeley, CA.

Jain, H., Khunteta, A., & Srivastava, S. (2021). Telecom churn prediction and used techniques, datasets and performance measures: a review. Telecommunication Systems, 76(4), 613-630.

Nokeri, T. C. (2022). Tree Modeling and Gradient Boosting with Scikit-Learn, XGBoost, PySpark, and H2O. In Data Science Solutions with Python (pp. 59-74). Apress, Berkeley, CA.

Pajankar, A. (2022). Visualizing Data with Pandas and Matplotlib. In Hands-on Matplotlib (pp. 211-241). Apress, Berkeley, CA.

Raff, E., Sylvester, J., & Mills, S. (2018, December). Fair forests: Regularized tree induction to minimize model bias. In Proceedings of the 2018 AAAI/ACM Conference on AI, Ethics, and Society (pp. 243-250).

Raja, P. S., & Thangavel, K. J. S. C. (2020). Missing value imputation using unsupervised machine learning techniques. Soft Computing, 24(6), 4361-4392.

Seger, C. (2018). An investigation of categorical variable encoding techniques in machine learning: binary versus one-hot and feature hashing.

Telco Customer Churn. Kaggle.com. (2022). Retrieved 31 March 2022, from https://www.kaggle.com/datasets/blastchar/telco-customer-churn.

Thambawita, V., Jha, D., Hammer, H. L., Johansen, H. D., Johansen, D., Halvorsen, P., & Riegler, M. A. (2020). An extensive study on cross-dataset bias and evaluation metrics interpretation for machine learning applied to gastrointestinal tract abnormality classification. ACM Transactions on Computing for Healthcare, 1(3), 1-29.

What Will You Get?

We provide professional writing services to help you score straight A’s by submitting custom written assignments that mirror your guidelines.

Premium Quality

Get result-oriented writing and never worry about grades anymore. We follow the highest quality standards to make sure that you get perfect assignments.

Experienced Writers

Our writers have experience in dealing with papers of every educational level. You can surely rely on the expertise of our qualified professionals.

On-Time Delivery

Your deadline is our threshold for success and we take it very seriously. We make sure you receive your papers before your predefined time.

24/7 Customer Support

Someone from our customer support team is always here to respond to your questions. So, hit us up if you have got any ambiguity or concern.

Complete Confidentiality

Sit back and relax while we help you out with writing your papers. We have an ultimate policy for keeping your personal and order-related details a secret.

Authentic Sources

We assure you that your document will be thoroughly checked for plagiarism and grammatical errors as we use highly authentic and licit sources.

Moneyback Guarantee

Still reluctant about placing an order? Our 100% Moneyback Guarantee backs you up on rare occasions where you aren’t satisfied with the writing.

Order Tracking

You don’t have to wait for an update for hours; you can track the progress of your order any time you want. We share the status after each step.

image

Areas of Expertise

Although you can leverage our expertise for any writing task, we have a knack for creating flawless papers for the following document types.

Areas of Expertise

Although you can leverage our expertise for any writing task, we have a knack for creating flawless papers for the following document types.

image

Trusted Partner of 9650+ Students for Writing

From brainstorming your paper's outline to perfecting its grammar, we perform every step carefully to make your paper worthy of A grade.

Preferred Writer

Hire your preferred writer anytime. Simply specify if you want your preferred expert to write your paper and we’ll make that happen.

Grammar Check Report

Get an elaborate and authentic grammar check report with your work to have the grammar goodness sealed in your document.

One Page Summary

You can purchase this feature if you want our writers to sum up your paper in the form of a concise and well-articulated summary.

Plagiarism Report

You don’t have to worry about plagiarism anymore. Get a plagiarism report to certify the uniqueness of your work.

Free Features $66FREE

  • Most Qualified Writer $10FREE
  • Plagiarism Scan Report $10FREE
  • Unlimited Revisions $08FREE
  • Paper Formatting $05FREE
  • Cover Page $05FREE
  • Referencing & Bibliography $10FREE
  • Dedicated User Area $08FREE
  • 24/7 Order Tracking $05FREE
  • Periodic Email Alerts $05FREE
image

Services offered

Join us for the best experience while seeking writing assistance in your college life. A good grade is all you need to boost up your academic excellence and we are all about it.

  • On-time Delivery
  • 24/7 Order Tracking
  • Access to Authentic Sources
Academic Writing

We create perfect papers according to the guidelines.

Professional Editing

We seamlessly edit out errors from your papers.

Thorough Proofreading

We thoroughly read your final draft to identify errors.

image

Delegate Your Challenging Writing Tasks to Experienced Professionals

Work with ultimate peace of mind because we ensure that your academic work is our responsibility and your grades are a top concern for us!

Check Out Our Sample Work

Dedication. Quality. Commitment. Punctuality

Categories
All samples
Essay (any type)
Essay (any type)
The Value of a Nursing Degree
Undergrad. (yrs 3-4)
Nursing
2
View this sample

It May Not Be Much, but It’s Honest Work!

Here is what we have achieved so far. These numbers are evidence that we go the extra mile to make your college journey successful.

0+

Happy Clients

0+

Words Written This Week

0+

Ongoing Orders

0%

Customer Satisfaction Rate
image

Process as Fine as Brewed Coffee

We have the most intuitive and minimalistic process so that you can easily place an order. Just follow a few steps to unlock success.

See How We Helped 9000+ Students Achieve Success

image

We Analyze Your Problem and Offer Customized Writing

We understand your guidelines first before delivering any writing service. You can discuss your writing needs and we will have them evaluated by our dedicated team.

  • Clear elicitation of your requirements.
  • Customized writing as per your needs.

We Mirror Your Guidelines to Deliver Quality Services

We write your papers in a standardized way. We complete your work in such a way that it turns out to be a perfect description of your guidelines.

  • Proactive analysis of your writing.
  • Active communication to understand requirements.
image
image

We Handle Your Writing Tasks to Ensure Excellent Grades

We promise you excellent grades and academic excellence that you always longed for. Our writers stay in touch with you via email.

  • Thorough research and analysis for every order.
  • Deliverance of reliable writing service to improve your grades.
Place an Order Start Chat Now
image

Order your essay today and save 30% with the discount code ESSAYHELP