Path: blob/master/cpd4.7/notebooks/python_sdk/deployments/spss/Use SPSS to predict customer churn.ipynb
6405 views
Use SPSS to predict customer churn with ibm-watson-machine-learning
This notebook contains steps to deploy sample SPSS stream, and start scoring new data.
Some familiarity with bash is helpful. This notebook uses Python 3.10.
You will use a data set, Telco Customer Churn, which details anonymous customer data from a telecommunication company. Use the details of this data set to predict customer churn which is very critical to business as it's easier to retain existing customers rather than acquiring new ones.
Learning goals
The learning goals of this notebook are:
Working with the Watson Machine Learning instance
Online deployment of SPSS model
Scoring data using deployed model
Contents
This notebook contains the following parts:
Connection to WML
Authenticate the Watson Machine Learning service on IBM Cloud Pack for Data. You need to provide platform url
, your username
and api_key
.
Alternatively you can use username
and password
to authenticate WML services.
Install and import the ibm-watson-machine-learning
package
Note: ibm-watson-machine-learning
documentation can be found here.
Working with spaces
First of all, you need to create a space that will be used for your work. If you do not have space already created, you can use {PLATFORM_URL}/ml-runtime/spaces?context=icp4data
to create one.
Click New Deployment Space
Create an empty space
Go to space
Settings
tabCopy
space_id
and paste it below
Tip: You can also use SDK to prepare the space for your work. More information can be found here.
Action: Assign space ID below
You can use list
method to print all existing spaces.
To be able to interact with all resources available in Watson Machine Learning, you need to set space which you will be using.
Store SPSS sample model in your Watson Machine Learning instance.
Note: You can see that model is successfully stored in Watson Machine Learning Service.
As we can see this sample telco customer is satisfied ("Predicted Churn", "No").
If you want to clean up all created assets:
experiments
trainings
pipelines
model definitions
models
functions
deployments
please follow up this sample notebook.
You successfully completed this notebook! You learned how to use Watson Machine Learning for SPSS model deployment and scoring.
Check out our Online Documentation for more samples, tutorials, documentation, how-tos, and blog posts.
Author
Lukasz Cmielowski, PhD, is an Automation Architect and Data Scientist at IBM with a track record of developing enterprise-level applications that substantially increases clients' ability to turn data into actionable knowledge.
Copyright © 2020-2025 IBM. This notebook and its source code are released under the terms of the MIT License.