Example: Customer Churn


Using Keras to predict customer churn based on the IBM Watson Telco Customer Churn dataset. We also demonstrate using the lime package to help explain which features drive individual model predictions. In addition, we use three new packages to assist with Machine Learning: recipes for preprocessing, rsample for sampling data and yardstick for model metrics.

Background: Recreate the example in the “Deep Learning With Keras To Predict Customer Churn” post, published by Matt Dancho in the Tensorflow R package’s blog. The goal is to analyze the Telco Customer Churn Data using R with Keras and Tensorflow.

Code: https://github.com/sol-eng/tensorflow-w-r

R Notebook - Modeling

In Connect: …/churn/modeling/tensorflow-w-r.nb.html

Screenshot of Churn Correlations.

Built with: tensorflow, keras, lime, rsample, yardstick, corrr

R Notebook - Workflow

In Connect: …/churn/workflow/tensorflow-drake.nb.html

Screenshot of Drake dependency graph

Built with: tensorflow, keras, tidyverse, drake, yardstick

Tensorflow model

In Connect: …/churn/tfmodel/

Screenshot of Tensorflow Model deployed to Connect

Built with: Tensorflow, Keras

Shiny app

In Connect: …/churn/overtime/

Screenshot of Shiny app

Built with: shiny, recipies, httr, shinymaterial, r2d3

Back to top