This lab is provided as part of the AWS Innovate Online Conference. It has been adapted from an AWS blog post.
ℹ️ You will run this lab in your own AWS account. Please follow directions at the end of the lab to remove resources to minimize costs.
Losing customers is costly for any business. Identifying unhappy customers early on gives you a chance to offer them incentives to stay. This notebook describes using machine learning (ML) for the automated identification of unhappy customers, also known as customer churn prediction. ML models rarely give perfect predictions though, so this notebook is also about how to incorporate the relative costs of prediction mistakes when determining the financial outcome of using ML.
We use an example of churn that is familiar to all of us–leaving a mobile phone operator. It seems like you can always find fault with my provider du jour! And if your provider knows that I’m thinking of leaving, it can offer timely incentives–you can always use a phone upgrade or perhaps have a new feature activated–and you might just stick around. Incentives are often much more cost effective than losing and reacquiring a customer.
You will use AWS CloudFormation to deploy Amazon SageMaker in your AWS account. It will be deployed in the Sydney region. Please ensure you follow directions at the end of the lab to delete the CloudFormation stack to remove resources.
1. Login to your AWS account.
2. Right-click this link and open in a new browser tab: Launch Stack into ap-southeast-2 with CloudFormation
If that fails due to a file not found, then instead:
- Right-click this link and download it to your computer: sagemaker-churn-lab.yaml
- In the CloudFormation management console, Create stack and upload the YAML file you just downloaded
3. Click Next three times.
4. At the bottom of the page, select "I acknowledge that AWS CloudFormation might create IAM resources".
5. Click Create stack.
This will launch an Amazon SageMaker notebook instance. It will take approximately 3 minutes.
6. In the Services menu at the top of the page, select Amazon SageMaker.
7. In the left navigation pane, click Notebook instances.
A SageMaker notebook instance will be displayed.
8. Click Open Jupyter in the right-hand column.
This will open a new browser tab to the Jupyter interface.
9. Click lab_notebook.ipynb.
This will open the notebook that will be used for the lab.
Please follow the instructions in the notebook. At the conclusion of the lab, please return the page you are currently reading to delete the CloudFormation template.
When you have completed the lab, you must delete the CloudFormation stack as follows:
10. Return to the AWS console and use the Services menu to go to CloudFormation.
11. Select the CloudFormation stack (click the circle).
12. Click Delete.
This will delete the stack and will stop charges being incurred in your AWS account.