Infuse AI into your application
Create and deploy a customer churn prediction model with IBM Cloud Pak for Data, Spark MLlib, and Jupyter notebooks
In this code pattern, we’ll use IBM Cloud Pak for Data and load customer demographic and trading activity data into IBM Db2 Warehouse. From there, we’ll analyze the data using a Jupyter notebook with Brunel visualizations. Finally, we’ll use Spark machine learning library to create a model that predicts customer churn risk. The model will be deployed as a web service and used for inference in an application.
This code pattern demonstrates the use of a Jupyter notebook to interact with Db2 Warehouse, Brunel visualizations, and Spark machine learning library — from the creation of database objects to advanced analytics and machine learning model development and deployment. This code pattern is built on IBM Cloud Pak for Data, an open, cloud-native information architecture for AI. With this integrated, fully governed team platform, you can keep your data secure at its source and add preferred data and analytics microservices flexibly. Simplify how you collect, organize, and analyze data to infuse AI across your business.
The sample data used in this code pattern provides customer demographics and trading activity for an online stock trading company. In this use case, the company would like to predict the risk of customer churn and integrate targeted incentives into their user-facing applications.
After completing this code pattern, you’ll understand how to:
- Find your way around IBM Cloud Pak for Data.
- Load data into Db2 Warehouse.
- Create an analytics project in IBM Cloud Pak for Data.
- Add a remote data set to your project.
- Use Jupyter notebooks.
- Visualize data using Brunel charts.
- Build and test a machine learning model with Spark MLlib.
- Deploy the model as a web service with IBM Cloud Pak for Data.
- Access the model from an external application for inference (churn risk prediction).
- Data is loaded into Db2 Warehouse
- Jupyter notebook accesses data
- Jupyter notebook uses Brunel for information visualization
- Jupyter notebook uses Spark ML library to create a model
- Jupyter notebook saves the model to the repository for deployment
- Applications access the model via the REST API
Find the detailed steps for this pattern in the readme file. The steps will show you how to:
- Clone the repo.
- Load the data into Db2 Warehouse.
- Set up an analytics project.
- Create the notebook.
- Insert a Spark DataFrame.
- Run the notebook.
- Analyze the results.
- Test the model in the UI.
- Deploy the model.
- Use the model in an app.