Over a million developers have joined DZone.

Detecting Churn with AI

DZone's Guide to

Detecting Churn with AI

By using a tool like Deep Learning Studio, a model can be built and deployed in minutes. Based on the results, the model could be tweaked for improvement and then retrained very quickly.

· AI Zone ·
Free Resource

Bias comes in a variety of forms, all of them potentially damaging to the efficacy of your ML algorithm. Read how Alegion's Chief Data Scientist discusses the source of most headlines about AI failures here.

Within the telecom industry, one of the biggest challenges of a service provider is to minimize churn. Churn is when a subscriber cancels their telecommunications service to move to another service provider. The cost of a subscriber churning to another service provider can be quite large. In general, it is much less expensive to keep a customer than to sign on a new customer. If there was a way to take information about subscribers and predict if a subscriber might move to another service provider, the result would be very beneficial. Even if the prediction was only 75-80% accurate, it would greatly help to reduce the cost of churning.

For this analysis, we will look at developing a model that is more than 80% accurate at predicting if a subscriber will move to another service provider.

About the Dataset

The dataset for this problem has been collected and provided by IBM. You can learn more about this dataset by checking out this link. 

The data is a set of characteristics about a subscriber. They include:

  • Customer ID
  • Customer gender
  • If the customer is a senior citizen
  • If the customer has a partner
  • If the customer has dependents
  • Number of months the customer has stayed with the company
  • If the customer has phone service
  • If the customer has multiple lines
  • Customer’s internet service connectivity
  • If the customer uses online security or not
  • If the customer uses online backup or not
  • If the customer has device protection
  • If the customer uses tech support
  • If the customer has streaming TV service
  • If the customer has streaming movies service
  • The customer’s contract term
  • If the customer uses paperless billing or not
  • The customer’s payment method
  • The amount charged to the customer monthly
  • The total amount charged to the customer

The last key piece of data about the subscriber is whether the customer churned or not.

Determining Churn

Before we focus on the model, we need to look at preparing the data. In this example, most of the data is categorical data (either yes/no data or some version of yes/no/not applicable). Some of the data is numerical data (i.e., the amount charged to the customer). For some of the numerical data, there is no information. We will simply skip any data samples that are incomplete. That will reduce our total data by a few samples.

One piece of data is not applicable to the model; and that is the customer ID. This is unique to the subscriber and will not be helpful in generating a general model to determine churn. For the sake of our model, we will ignore this data.

1. Project Creation

After logging in to Deep Learning Studio, select Projects and click on the + button to create a new project. Name the project “Telecom Churn.”

Image title2. Dataset Intake

To import the telco customer churn data, select the Datasets tab on the left. From that tab, the data can be imported. Remember to name and remove the incomplete data as we described before. Name the file train.csv, place it in a folder with the name of the data (i.e., telco-customer-churn), and zip that folder.

Image title

After the data has been imported, select your project, and then select the Data tab. Set the “Train/Validation/Test Split” to 80% - 20% - 0%. This is a good split between training and validation, but another split can be used as well. Set Load Dataset in Memory to “Full dataset.” Note that “Input or Output” for customerID is blank. That is what is desired since we don’t want to include that data in the analysis.

Image title

Also, for the churn data, the “Input or Output” should be set to Output. This is the data that the tool will use to train the model we are creating.

Image title

3. Create Neural Network

The neural network can be created by dragging and dropping layers. For this model, we will only use the input, output, and dense layers.

Image title

For Dense layers 1-8, the activation function has been set to ReLu. For Dense_9 the activation function has been set to softmax. The number of neurons for each layer are shown above. It is critical for layer Dense_9 to have two neurons, as there are only two possible categories: either yes, the subscriber will churn, or no, the subscriber will not churn.

 4. Hyperparameter and Training

By selecting the Hyperparameters tab, hyperparameters can be set. The parameters that we used are shown below. These can be changed based on your preferences.

Image title

The last step is to train the model. Training can be started from the Training tab and can be monitored from the training dashboard. Once the training has been completed, the results can be checked from the Results tab.

Image title

5. Deploying Your Model

With Deep Learning Studio, the trained model can be deployed via a REST API or downloaded and integrated into another application. Both can be done from the Inference/Deploy tab. Then, you can use Download tab to download the model.

Image title

Or, you can use the Deploy tab to deploy via a REST API.

Image title

By using a tool like Deep Learning Studio, a model can be built and deployed in minutes. Based on the results, the model could be tweaked for improvement and then retrained very quickly.

Thanks for reading.

Your machine learning project needs enormous amounts of training data to get to a production-ready confidence level. Get a checklist approach to assembling the combination of technology, workforce and project management skills you’ll need to prepare your own training data.

telecommunication services ,machine learning applications ,artificial intelligence ,ai ,deep learning

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}