Digital Developer Conference: Hybrid Cloud 2021. On Sep 21, gain free hybrid cloud skills from experts and partners. Register now

Predict home value using Python and machine learning

This code pattern is part of the Db2 for AI learning path.


Data keeps on growing, and the ability to extract meaningful information out of that data is very important. Using machine learning models out of existing data helps a company to extract meaningful insights and also predict future results. IBM Watson Studio is an integrated environment for data scientists, developers, and domain experts to collaboratively work with data to build, train and deploy models at scale. IBM Machine Learning service, along with IBM Db2 Database, can be used to create machine learning models by applying various machine learning algorithms, which then can be used to predict future results.


This code pattern demonstrates a data scientist’s journey in creating a machine learning model using IBM Watson Studio and IBM Db2 On Cloud. The pattern uses Jupyter notebook to connect to the Db2 database and uses a machine learning algorithm to create a model which is deployed to IBM Watson machine Learning service. This deployed model can now be used by exposing an API and use the input data to the API to predict home values.

After you’ve completed this code pattern, you’ll understand how to:

  • Create a project in Watson Studio and use Jupyter Notebooks in the project
  • Create machine learning models using Python libraries
  • Deploy the machine learning model to IBM Watson Machine Learning service on Cloud
  • Use Angular UI to send data to IBM Watson Machine Learning API to predict home value



  1. Create a Watson Studio Project on IBM Cloud.
  2. IBM DB2 on Cloud Database stores information that will be used for machine learning and predictions.
  3. Watson Machine Learning helps to create ML models so that new predictions can be run against the model.
  4. Jupyter notebook uses IBM Db2 on Cloud and Watson Machine Learning to create the machine learning model.
  5. The model is exposed through and API.
  6. Angular UI uses the API to send new data for predictions.


Ready to put this code pattern to use? Complete details on how to get started running and using this application are in the README.


This code pattern demonstrated a data scientist’s journey in creating a machine learning model using IBM Watson Studio and IBM Db2 On Cloud. The code pattern is the final part of the Learning Path: Db2 for AI series. Congratulations! You should now have a fundamental understanding of Db2 for AI and some of its advanced features.