Skip to content

IBM/watson-machine-learning-samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample notebooks for IBM watsonx.ai for IBM Cloud and IBM watsonx.ai software product

The sample notebooks in this repo demonstrate Watson Machine Learning and watsonx.ai capabilities such as:

  • Running experiments on model building using AutoAI or Deep Learning
  • Deploying third-party models as web services or batch jobs (i.e.: scikit-learn, xgboost, keras, PMMl, SPSS, etc.)
  • Monitoring deployments with OpenScale (drift, bias detection)
  • Managing model lifecycles (updating the model version, refreshing a deployment)
  • Inferencing watsonx.ai foundation models
  • Integrating LangChain with watsonx.ai

Notebooks with Python code and the Python SDK can be found in the python_sdk folder. The REST API examples are organized in the rest_api folder.

Deployments

This section contains sample notebooks with examples of how to serve different types of models, either as online or batch jobs.

Notebook Description cloud CPD 4.0 CPD 4.5 CPD 4.6 CPD 4.7 CPD 4.8 CPD 5.0 CPD 5.1
Use a custom software spec to create a statsmodels function Demonstrates how to deploy a Python function with statsmode in Watson Machine Learning. For this, you need to create a custom software specification using a conda yaml file with all of the required libraries. link link link link link link link link
Use a function to recognize hand-written digits Demonstrates how to create and deploy a function that receives HTML canvas image data from a web app and then sends that data to a model trained to recognize handwritten digits. link link link link link link link link
Use scikit-learn to recognize hand-written digits Demonstrates how to persist and deploy a locally trained scikit-learn model in Watson Machine Learning. link link link link link link link link
Use scikit-learn and a custom library to predict temperature Demonstrates how to train a scikit-learn model that uses a custom defined transformer and then how to use it with Watson Machine Learning. link link link link link link link link
Use watsonx, and LangChain to make a series of calls to a language model Demonstrates how to chain google/flan-ul2 and google/flan-t5-xxl models to generate a sequence of creating a random question on a given topic and an answer to that question. This notebook familiarizes the user with the LangChain framework, using simple chain (LLMChain) and the extended chain (SimpleSequentialChain) with the WatsonxLLM. link - - - - link link link
Use watsonx to tune IBM 'granite-13b-instruct-v2' model with cars4u document Demonstrates how to do prompt tuning in watsonx. link - - - - link link link
Use watsonx Granite Model Series, Chroma, and LangChain to answer questions (RAG) Demonstrates how to use Retrieval Augumented Generation (RAG) in watsonx.ai. It introduces commands for data retrieval, knowledge base building and querying, and model testing. link - - - - link link link
Use watsonx to manage Prompt Template assets and create deployment Demonstrates how to create a Prompt Template Asset and how to create a deployment pointing on it. link - - - - link link link
Use watsonx Text Extraction service to extract text from file This notebook contains the steps and code demonstrating how to run a Text Extraction job using python SDK and then retrieve the results in the form of markdown file. link - - - - - - link
Use watsonx, and mistralai/mistral-large to make simple chat conversation and tool calls This notebook provides a detailed demonstration of the steps and code required to showcase support for Chat models, including the integration of tools and watsonx.ai models. link - - - - - - link
Use watsonx, and mistralai/mistral-large with support for tools to perform simple calculations This notebook provides a detailed demonstration of the steps and code required to showcase support for Chat models, including the integration of tools using LangGraph and watsonx.ai models. link - - - - - - link
Use watsonx, and meta-llama/llama-3-2-11b-vision-instruct model for image processing to generate a description of the IBM logo This notebook provides a detailed demonstration of the steps and code required to showcase support for Chat models. link - - - - - - link

Experiments

This section contains sample notebooks with examples of how to use AutoAI and Deep Learning experiments. The notebooks show how to trigger such an experiment, work with trained models, and do model comparison, refinery, and finally deployment.

Notebook Description cloud CPD 4.0 CPD 4.5 CPD 4.6 CPD 4.7 CPD 4.8 CPD 5.0 CPD 5.1
Use AutoAI and Lale to predict credit risk Demonstrates how to use AutoAI experiments by getting a German credit data set and training the model to predict banking credit. link link link link link link link link
Use AutoAI and timeseries data to predict COVID cases Demonstrates how to use AutoAI experiments for timeseries data sets in Watson Machine Learning service. link - link link link link link link
Use AutoAI to train fair models Demonstrates how to use AutoAI experiments with bias detection/mitigation in Watson Machine Learning. link - link link link link link link
Use Lale AIF360 scorers to calculate and mitigate bias for credit risk AutoAI model Demonstrate how to use AutoAI experiments in Watson Machine Learning. link link link link link link link link
Use PyTorch to recognize hand-written digits Demonstrates how to use Deep Learning model training and scoring in Watson Machine Learning. - link link link link link link link
Use AutoAI RAG and Chroma to create a pattern and get information from ibm-watsonx-ai SDK documentation This notebook contains the steps and code to demonstrate the usage of IBM AutoAI RAG. The AutoAI RAG experiment conducted in this notebook uses data scraped from the ibm-watsonx-ai SDK documentation. link - - - - - - link
Use AutoAI RAG and Milvus database to work with ibm-watsonx-ai SDK documentation This notebook contains the steps and code to demonstrate the usage of IBM AutoAI RAG. The AutoAI RAG experiment conducted in this notebook uses data scraped from the ibm-watsonx-ai SDK documentation. link - - - - - - link

Instance Management

This section contains sample notebooks with examples that show how to work with the Watson Machine Learning instance.

Notebook Description cloud CPD 4.0 CPD 4.5 CPD 4.6 CPD 4.7 CPD 4.8 CPD 5.0 CPD 5.1
Machine Learning artifacts export and import Demonstrates an example of exporting and importing assets using Watson Machine Learning. link link link link link link link link
Machine Learning artifacts management Demonstrates how to manage and clean up a Watson Machine Learning instance. link link link link link link link link
Space management Demonstrates how to manage spaces in the context of Watson Machine Learning. link link link link link link link link

Lifecycle Management

This section contains sample notebooks with examples that show how to update an existing model version and refresh an existing deployment in-place.

Notebook Description cloud CPD 4.0 CPD 4.5 CPD 4.6 CPD 4.7 CPD 4.8 CPD 5.0 CPD 5.1
Use python API to automate AutoAI deployment lifecycle Demonstrates how to use the AI Lifecycle features from the AutoAI model in Watson Machine Learning. link - - - link link link link
Use scikit-learn and AI lifecycle capabilities to predict Boston house prices Demonstrates how to use the AI Lifecycle features in Watson Machine Learning. link link link link link link link link