Icon

Building a Churn Prediction Model

This workflow is an example of how to build a basic PMML model for a churn prediction using a Decision Tree algorithm.

URL: Build a workflow https://www.knime.com/getting-started
URL: KNIME Quickstart Guide https://docs.knime.com/latest/analytics_platform_quickstart_guide/index.html

Building a Churn Prediction Model

This workflow illustrates how to build and evaluate a churn prediction model, i.e. predict the likelihood that a customer will churn a specific contract.

Task

Train and evaluate a model to predict customer churn.

Data Reading

Two files:

- Contract data + churn

- Behavioral (calls) data

Both files are located in TheData/Customers

Pre-processing

- Join contract data and behavioral data

- Convert Churn values to String to be used as class in upcoming classification

- Color rows by churn value

- Reserve 80% of the rows for model training and remaining 20% for model testing

- Use same distribution of classes in training and testing

Train a Model

The Decision Tree here is just an example.

Open the Decision Tree Learner view to see the decision tree paths.

Score the Model

Remember to use the Predictor node appropriate for your model!

Evaluate predictions based on confusion matrix created with the Scorer node.

Churn = 0 customer remained with contract

Churn = 1 customer quit contract

training set

test set

Training set 80% vs. Test set 20%
Table Partitioner
Match original vs. predicted Churn values
Scorer
Save model in PMML format
PMML Writer
Apply the trained model to predict Churn
Decision Tree Predictor
Reading ContractData.csv
CSV Reader
Join the contract data and the behavioral data
Joiner
Target Class = Churn
Decision Tree Learner
Reading CallsData.xls
Excel Reader
Area code and churn 0/1 are converted to String.
Number to String

Nodes

Extensions

Links