Create and deploy a scoring model to predict heartrate failure  

Use IBM Watson Studio to build a predictive model with Watson Machine Learning

Last updated | By Justin McCoy, David Carew


Machine learning is branching out across numerous fields, one of the most interesting fields is health care. This code pattern uses a Jupyter Notebook on IBM Watson Studio to build a predictive model that demonstrates a potential healthcare use case. This predictive model is deployed into production on Watson’s Machine Learning Service and invoked by a custom Node.js app running on a Cloud Foundry Runtime in IBM’s Cloud.


You’re a busy developer or data scientist and want the fastest path delivering data insights to users, but this requires deep expertise in many technology domains. This end-to-end example walks you through the numerous technologies used to:

  • Acquire, clean, and explore data
  • Build a predictive machine learning model
  • Make predictions
  • Host the model for consumption
  • Call the hosted model from a Node.js application

Along the way, you’ll learn about IBM’s Watson Machine Learning Service for hosting your trained model on IBM’s Cloud, and IBM Watson Studio, a Cloud-based IDE for data science teams; tools that bring together many open-source technologies built for data science and machine learning.

In this code pattern, you will use a Jupyter Notebook on IBM Watson Studio to build a predictive model that demonstrates a potential healthcare use case. Although this is for demonstrative purposes only, you’ll see how to use Watson Machine Learning on a data set comprised of health care metrics to create a predictive model for risk of heart failure. After creating this model, inputs that are entered can be scored to form a prediction for an individual case. Note that this application is used for demonstrative and illustrative purposes only and does not constitute an offering that has gone through regulatory review.

After completing this code pattern, you will understand how to:

  • Build a predictive model within a Jupyter Notebook
  • Deploy the model to IBM Watson Machine Learning service
  • Access the machine learning model through either APIs or a Node.js app


  1. The developer creates an IBM Watson Studio Workspace.
  2. IBM Watson Studio depends on an Apache Spark service.
  3. IBM Watson Studio uses Cloud Object storage to manage your data.
  4. This lab is built on a Jupyter Notebook, this is where the developer will import data, train, and evaluate their model.
  5. Import heart failure data.
  6. Trained models are deployed into production using IBM’s Watson Machine Learning Service.
  7. A Node.js web app is deployed on IBM Cloud and calls the predictive model.
  8. A user visits the web app, enters their information, and the predictive model returns a response.


Find the detailed steps for this pattern in the README. The steps will show you how to:
  1. Deploy the testing application
  2. Create an instance of the Watson Machine Learning Service
  3. Create an instance of the Data Science Experience Service
  4. Create a project in IBM Data Science Experience and bind it to your Watson Machine Learning service instance
  5. Save the credentials for your Watson Machine Learning Service
  6. Create a notebook in IBM Data Science Experience
  7. Run the notebook in IBM Data Science Experience
  8. Deploy the saved predictive model as a scoring service

Related Blogs

Two “edgy” AI TensorFlow models for you!

The global Call for Code is well underway, we want to share some visual recognition models which could help you. These AI models can operate on the edge, which could be particularly useful for this years’ theme: disaster preparedness. How could visual recognition help in relief work? From satellite and drone imagery analysis, to classifying...

Continue reading Two “edgy” AI TensorFlow models for you!

Leveraging the power of AI at Unite Berlin

Last week, from June 19 – 21, we were at Unity’s premiere in Berlin: Unite 2018. This conference brought together Unity’s video game and development community. Unity touches 770 million gamers all over the world and is the market leader for consumer AR and VR use cases and is also rapidly emerging as the market...

Continue reading Leveraging the power of AI at Unite Berlin

Related Links

Keras examples

Examples are a great way to learn, get some from the Keras team


Take your Watson app to the next level with these resources

Spark on IBM Cloud

Need a Spark cluster? Create up to 30 Spark executors with our Spark service