Vertex AI Jupyter Notebook tutorials

This document contains a list of all the Vertex AI Jupyter Notebook tutorials. They're end-to-end tutorials that show you how to preprocess data, train, deploy, and use the models for inference.

There are many environments in which you can host Jupyter Notebooks. You can:

  • Download them from GitHub and run them on your local machine
  • Download them from GitHub and run them on a Jupyter or JupyterLab server in your local network
  • Run them in the cloud using a service like Colaboratory (Colab) or Vertex AI Workbench.

Colab

Running a Jupyter Notebook in Colab is an easy way to get started quickly.

To open a notebook tutorial in Colab, click the Colab link in the notebook list. Colab creates a VM instance with all needed dependencies, launches the Colab environment, and loads the notebook.

Vertex AI Workbench

You can also run the notebook using user-managed notebooks. When you create a user-managed notebooks instance with Vertex AI Workbench, you have full control over the hosting VM. You can specify the configuration and environment of the hosting VM.

To open a notebook tutorial in a Vertex AI Workbench instance:

  1. Click the Vertex AI Workbench link in the notebook list. The link opens the Vertex AI Workbench console.
  2. In the Deploy to notebook screen, type a name for your new Vertex AI Workbench instance and click Create.
  3. In the Ready to open notebook dialog that appears after the instance starts, click Open.
  4. On the Confirm deployment to notebook server page, select Confirm.
  5. Before running the notebook, select Kernel > Restart Kernel and Clear all Outputs.

List of notebooks

Services Description Open in
Classification for tabular data
AutoML Tabular training and prediction.
Learn how to train and make predictions on an AutoML model based on a tabular dataset. Learn more about Classification for tabular data.

Tutorial steps

  • Create a Vertex AI model training job.
  • Train an AutoML Tabular model.
  • Deploy the Model resource to a serving Endpoint resource.
  • Make a prediction by sending data.
  • Undeploy the Model resource.
Colab
GitHub
Vertex AI Workbench
Classification for text data
Create, train, and deploy an AutoML text classification model.
Learn how to use AutoML to train a text classification model. Learn more about Classification for text data.

Tutorial steps

  • Create a Vertex AI Dataset.
  • Train an AutoML text classification Model resource.
  • Obtain the evaluation metrics for the Model resource.
  • Create an Endpoint resource.
  • Deploy the Model resource to the Endpoint resource.
  • Make an online prediction
  • Make a batch prediction
Colab
GitHub
Vertex AI Workbench
Get predictions from an image classification model
AutoML training image classification model for batch prediction.
In this tutorial, you create an AutoML image classification model from a Python script, and then do a batch prediction using the Vertex AI SDK. Learn more about Get predictions from an image classification model.

Tutorial steps

  • Create a Vertex AI Dataset resource.
  • Train the model.
  • View the model evaluation.
  • Make a batch prediction.
Colab
GitHub
Vertex AI Workbench
Get predictions from an image classification model
AutoML training image classification model for online prediction.
In this tutorial, you create an AutoML image classification model and deploy for online prediction from a Python script using the Vertex AI SDK. Learn more about Get predictions from an image classification model.

Tutorial steps

  • Create a Vertex AI Dataset resource.
  • Train the model.
  • View the model evaluation.
  • Deploy the Model resource to a serving Endpoint resource.
  • Make a prediction.
  • Undeploy the Model.
Colab
GitHub
Vertex AI Workbench
AutoML
AutoML training image object detection model for export to edge.
In this tutorial, you create an AutoML image object detection model from a Python script using the Vertex AI SDK, and then export the model as an Edge model in TFLite format.

Tutorial steps

  • Create a Vertex AI Dataset resource.
  • Train the model.
  • Export the Edge model from the Model resource to Cloud Storage.
  • Download the model locally.
  • Make a local prediction.
Colab
GitHub
Vertex AI Workbench
Object detection for image data
AutoML training image object detection model for online prediction.
In this tutorial, you create an AutoML image object detection model and deploy for online prediction from a Python script using the Vertex AI SDK. Learn more about Object detection for image data.

Tutorial steps

  • Create a Vertex AI Dataset resource.
  • Train the model.
  • View the model evaluation.
  • Deploy the Model resource to a serving Endpoint resource.
  • Make a prediction.
  • Undeploy the Model.
Colab
GitHub
Vertex AI Workbench
Tabular Workflow for E2E AutoML
AutoML Tabular Workflow pipelines.
Learn how to create two regression models using Vertex AI Pipelines downloaded from Google Cloud Pipeline Components . Learn more about Tabular Workflow for E2E AutoML.

Tutorial steps

  • Create a training pipeline that reduces the search space from the default to save time.
  • Create a training pipeline that reuses the architecture search results from the previous pipeline to save time.
Colab
GitHub
Vertex AI Workbench
Entity extraction for text data
AutoML training text entity extraction model for batch prediction.
In this tutorial, you create an AutoML text entity extraction model from a Python script, and then do a batch prediction using the Vertex AI SDK. Learn more about Entity extraction for text data.

Tutorial steps

  • Create a Vertex AI Dataset resource.
  • Train the model.
  • View the model evaluation.
  • Make a batch prediction.
Colab
GitHub
Vertex AI Workbench
AutoML
AutoML training text sentiment analysis model for batch prediction.
In this tutorial, you create an AutoML text sentiment analysis model from a Python script, and then do a batch prediction using the Vertex AI SDK.

Tutorial steps

  • Create a Vertex AI Dataset resource.
  • Train the model.
  • View the model evaluation.
  • Make a batch prediction.
Colab
GitHub
Vertex AI Workbench
AutoML training
Get started with AutoML Training.
Learn how to use AutoML for training with Vertex AI. Learn more about AutoML training.

Tutorial steps

  • Train an image model
  • Export the image model as an edge model
  • Train a tabular model
  • Export the tabular model as a cloud model
  • Train a text model
  • Train a video model
Colab
GitHub
Vertex AI Workbench
Hierarchical forecasting for tabular data
AutoML training hierarchical forecasting for batch prediction.
In this tutorial, you create an AutoML hierarchical forecasting model and deploy it for batch prediction using the Vertex AI SDK for Python. Learn more about Hierarchical forecasting for tabular data.

Tutorial steps

  • Create a Vertex AI TimeSeriesDataset resource.
  • Train the model.
  • View the model evaluation.
  • Make a batch prediction.
Colab
GitHub
Vertex AI Workbench
Object detection for image data
AutoML training image object detection model for batch prediction.
In this tutorial, you create an AutoML image object detection model from a Python script, and then do a batch prediction using the Vertex AI SDK. Learn more about Object detection for image data.

Tutorial steps

  • Create a Vertex AI Dataset resource.
  • Train the model.
  • View the model evaluation.
  • Make a batch prediction.
Colab
GitHub
Vertex AI Workbench
Forecasting for tabular data
AutoML tabular forecasting model for batch prediction.
Learn how to create an AutoML tabular forecasting model from a Python script, and then do a batch prediction using the Vertex AI SDK. Learn more about Forecasting for tabular data.

Tutorial steps

  • Create a Vertex AI Dataset resource.
  • Train an AutoML tabular forecasting Model resource.
  • Obtain the evaluation metrics for the Model resource.
  • Make a batch prediction.
Colab
GitHub
Vertex AI Workbench
Regression for tabular data
AutoML training tabular regression model for batch prediction using BigQuery.
Learn how to create an AutoML tabular regression model and deploy it for batch prediction using the Vertex AI SDK for Python. Learn more about Regression for tabular data.

Tutorial steps

  • Create a Vertex AI Dataset resource.
  • Train the model.
  • View the model evaluation.
  • Deploy the Model resource to a serving Endpoint resource.
  • Make a prediction.
  • Undeploy the Model.
Colab
GitHub
Vertex AI Workbench
Regression for tabular data
AutoML training tabular regression model for online prediction using BigQuery.
Learn how to create an AutoML tabular regression model and deploy for online prediction from a Python script using the Vertex AI SDK. Learn more about Regression for tabular data.

Tutorial steps

  • Create a Vertex AI Dataset resource.
  • Train the model.
  • View the model evaluation.
  • Deploy the Model resource to a serving Endpoint resource.
  • Make a prediction.
  • Undeploy the Model.
Colab
GitHub
Vertex AI Workbench
Entity extraction for text data
AutoML training text entity extraction model for online prediction.
Learn how to create an AutoML text entity extraction model and deploy for online prediction from a Python script using the Vertex AI SDK. Learn more about Entity extraction for text data.

Tutorial steps

  • Create a Vertex AI Dataset resource.
  • Train the model.
  • View the model evaluation.
  • Deploy the Model resource to a serving Endpoint resource.
  • Make a prediction.
  • Undeploy the Model.
Colab
GitHub
Vertex AI Workbench
Sentiment analysis for text data
Training an AutoML text sentiment analysis model for online predictions.
Learn how to create an AutoML text sentiment analysis model and deploy it for online predictions from a Python script using the Vertex AI SDK. Learn more about Sentiment analysis for text data.

Tutorial steps

  • Create a Vertex AI Dataset resource.
  • Create a training job for the AutoML model on the dataset.
  • View the model evaluation metrics.
  • Deploy the Vertex AI Model resource to a serving Vertex AI Endpoint.
  • Make a prediction request to the deployed model.
  • Undeploy the model from endpoint.
  • Perform clean up process.
Colab
GitHub
Vertex AI Workbench
Action recognition for video data
AutoML training video action recognition model for batch prediction.
Learn how to create an AutoML video action recognition model from a Python script, and then do a batch prediction using the Vertex AI SDK. Learn more about Action recognition for video data.

Tutorial steps

  • Create a Vertex AI Dataset resource.
  • Train the model.
  • View the model evaluation.
  • Make a batch prediction.
Colab
GitHub
Vertex AI Workbench
Classification for video data
AutoML training video classification model for batch prediction.
Learn how to create an AutoML video classification model from a Python script, and then do a batch prediction using the Vertex AI SDK. Learn more about Classification for video data.

Tutorial steps

  • Create a Vertex AI Dataset resource.
  • Train the model.
  • View the model evaluation.
  • Make a batch prediction.
Colab
GitHub
Vertex AI Workbench
Object tracking for video data
AutoML training video object tracking model for batch prediction.
Learn how to create an AutoML video object tracking model from a Python script, and then do a batch prediction using the Vertex AI SDK. Learn more about Object tracking for video data.

Tutorial steps

  • Create a Vertex AI Dataset resource.
  • Train the model.
  • View the model evaluation.
  • Make a batch prediction.
Colab
GitHub
Vertex AI Workbench
BigQuery ML
Get started with BigQuery ML Training.
Learn how to use BigQueryML for training with Vertex AI. Learn more about BigQuery ML.

Tutorial steps

  • Create a local BigQuery table in your project
  • Train a BigQuery ML model
  • Evaluate the BigQuery ML model
  • Export the BigQuery ML model as a cloud model
  • Upload the exported model as a Vertex AI Model resource
  • Hyperparameter tune a BigQuery ML model with Vertex AI Vizier
  • Automatically register a BigQuery ML model to Vertex AI Model Registry
Colab
GitHub
Vertex AI Workbench
Custom training
Vertex AI Prediction
Deploying Iris-detection model using FastAPI and Vertex AI custom container serving.
Learn how to create, deploy and serve a custom classification model on Vertex AI. Learn more about Custom training. Learn more about Vertex AI Prediction.

Tutorial steps

  • Train a model that uses flower's measurements as input to predict the class of iris.
  • Save the model and its serialized preprocessor.
  • Build a FastAPI server to handle predictions and health checks.
  • Build a custom container with model artifacts.
  • Upload and deploy custom container to Vertex AI Endpoints.
Colab
GitHub
Vertex AI Workbench
Vertex AI Training
Training a TensorFlow model on BigQuery data.
Learn how to create a custom-trained model from a Python script in a Docker container using the Vertex AI SDK for Python, and then get a prediction from the deployed model by sending data. Learn more about Vertex AI Training.

Tutorial steps

  • Create a Vertex AI custom TrainingPipeline for training a model.
  • Train a TensorFlow model.
  • Deploy the Model resource to a serving Endpoint resource.
  • Make a prediction.
  • Undeploy the Model resource.
Colab
GitHub
Vertex AI Workbench
Custom training
Custom training with custom training container and automatic registering of the model.
In this tutorial, you create a custom model from a Python script in a custom Docker container using the Vertex AI SDK, and automatically register the model in the Vertex AI Model Registry. Learn more about Custom training.

Tutorial steps

  • Create a Vertex AI custom job for training a model.
  • Train and register a TensorFlow model using a custom container,
  • List the registered model from the Vertex AI Model Registry.
Colab
GitHub
Vertex AI Workbench
Vertex AI TensorBoard Profiler
Profile model training performance using Profiler.
Learn how to enable Vertex AI TensorBoard Profiler for custom training jobs. Learn more about Vertex AI TensorBoard Profiler.

Tutorial steps

  • Setup a service account and a Cloud Storage bucket
  • Create a Vertex AI TensorBoard instance
  • Create and run a custom training job
  • View the Vertex AI TensorBoard Profiler dashboard
Colab
GitHub
Vertex AI Workbench
Custom training
Get started with Vertex AI Training for XGBoost.
Learn how to use Vertex AI Training for training a XGBoost custom model. Learn more about Custom training.

Tutorial steps

  • Training using a Python package.
  • Report accuracy when hyperparameter tuning.
  • Save the model artifacts to Cloud Storage using Cloud StorageFuse.
  • Create a Vertex AI Model resource.
Colab
GitHub
Vertex AI Workbench
Shared resources across deployments
Get started with Endpoint and shared VM.
Learn how to use deployment resource pools for deploying models. Learn more about Shared resources across deployments.

Tutorial steps

  • Upload a pretrained image classification model as a Model resource (model A).
  • Upload a pretrained text sentence encoder model as a Model resource (model B).
  • Create a shared VM deployment resource pool.
  • List shared VM deployment resource pools.
  • Create two Endpoint resources.
  • Deploy first model (model A) to first Endpoint resource using deployment resource pool.
  • Deploy second model (model B) to second Endpoint resource using deployment resource pool.
  • Make a prediction request with first deployed model (model A).
  • Make a prediction request with second deployed model (model B).
Colab
GitHub
Vertex AI Workbench
Custom training
Vertex AI Batch Prediction
Custom training and batch prediction.
Learn to use Vertex AI Training to create a custom trained model and use Vertex AI Batch Prediction to do a batch prediction on the trained model. Learn more about Custom training. Learn more about Vertex AI Batch Prediction.

Tutorial steps

  • Create a Vertex AI custom job for training a TensorFlow model.
  • Upload the trained model artifacts as a Model resource.
  • Make a batch prediction.
Colab
GitHub
Vertex AI Workbench
Custom training
Vertex AI Prediction
Custom training and online prediction.
Learn to use Vertex AI Training to create a custom-trained model from a Python script in a Docker container, and learn to use Vertex AI Prediction to do a prediction on the deployed model by sending data. Learn more about Custom training. Learn more about Vertex AI Prediction.

Tutorial steps

  • Create a Vertex AI custom job for training a TensorFlow model.
  • Upload the trained model artifacts to a Model resource.
  • Create a serving Endpoint resource.
  • Deploy the Model resource to a serving Endpoint resource.
  • Make a prediction.
  • Undeploy the Model resource.
Colab
GitHub
Vertex AI Workbench
BigQuery Datasets
Vertex AI for BigQuery users
Get started with BigQuery datasets.
Learn how to use BigQuery as a dataset for training with Vertex AI. Learn more about BigQuery Datasets. Learn more about Vertex AI for BigQuery users.

Tutorial steps

  • Create a Vertex AI Dataset resource from BigQuery table compatible for AutoML training.
  • Extract a copy of the dataset from BigQuery to a CSV file in Cloud Storage compatible for AutoML or custom training.
  • Select rows from a BigQuery dataset into a pandas dataframe compatible for custom training.
  • Select rows from a BigQuery dataset into a tf.data.Dataset compatible for custom training TensorFlow models.
  • Select rows from extracted CSV files into a tf.data.Dataset compatible for custom training TensorFlow models.
  • Create a BigQuery dataset from CSV files.
  • Extract data from BigQuery table into a DMatrix compatible for custom training XGBoost models.
Colab
GitHub
Vertex AI Workbench
Vertex AI Data Labeling
Get started with Vertex AI Data Labeling.
Learn how to use the Vertex AI Data Labeling service. Learn more about Vertex AI Data Labeling.

Tutorial steps

  • Create a Specialist Pool for data labelers.
  • Create a data labeling job.
  • Submit the data labeling job.
  • List data labeling jobs.
  • Cancel a data labeling job.
Colab
GitHub
Vertex AI Workbench
Vertex AI Experiments
Vertex ML Metadata
Build Vertex AI Experiment lineage for custom training.
Learn how to integrate preprocessing code in a Vertex AI experiments. Learn more about Vertex AI Experiments. Learn more about Vertex ML Metadata.

Tutorial steps

  • Execute module for preprocessing data
  • Create a dataset artifact
  • Log parameters
  • Execute module for training the model
  • Log parameters
  • Create model artifact
  • Assign tracking lineage to dataset, model and parameters
Colab
GitHub
Vertex AI Workbench
Vertex AI Experiments
Track parameters and metrics for locally trained models.
Learn how to use Vertex AI Experiments to compare and evaluate model experiments. Learn more about Vertex AI Experiments.

Tutorial steps

  • log the model parameters
  • log the loss and metrics on every epoch to Vertex AI TensorBoard
  • log the evaluation metrics
Colab
GitHub
Vertex AI Workbench
Vertex AI Experiments
Vertex AI Pipelines
Compare pipeline runs with Vertex AI Experiments.
Learn how to use Vertex AI Experiments to log a pipeline job and compare different pipeline jobs. Learn more about Vertex AI Experiments. Learn more about Vertex AI Pipelines.

Tutorial steps

  • Formalize a training component
  • Build a training pipeline
  • Run several Pipeline jobs and log their results
  • Compare different Pipeline jobs
Colab
GitHub
Vertex AI Workbench
Vertex AI TensorBoard
Delete Outdated Experiments in Vertex AI TensorBoard.
Learn how to delete outdated Vertex AI TensorBoard Experiments to avoid unnecessary storage costs. Learn more about Vertex AI TensorBoard.

Tutorial steps

  • How to delete the TB Experiment with a predefined keyvalue label pair
  • How to delete the TB Experiments created before the create_time
  • How to delete the TB Experiments created before the update_time
Colab
GitHub
Vertex AI Workbench
Vertex AI Experiments
Custom training autologging - Local script.
Learn how to autolog parameters and metrics of an ML experiment running on Vertex AI training by leveraging the integration with Vertex AI Experiments. Learn more about Vertex AI Experiments.

Tutorial steps

  • Formalize model experiment in a script
  • Run model traning using local script on Vertex AI Training
  • Check out ML experiment parameters and metrics in Vertex AI Experiments
Colab
GitHub
Vertex AI Workbench
Vertex AI Experiments
Vertex ML Metadata
Custom training
Get started with Vertex AI Experiments.
Learn how to use Vertex AI Experiments when training with Vertex AI. Learn more about Vertex AI Experiments. Learn more about Vertex ML Metadata. Learn more about Custom training.

Tutorial steps

  • Local (notebook) Training
  • Create an experiment
  • Create a first run in the experiment
  • Log parameters and metrics
  • Create artifact lineage
  • Visualize the experiment results
  • Execute a second run
  • Compare the two runs in the experiment
  • Cloud (Vertex AI) Training
  • Within the training script
Colab
GitHub
Vertex AI Workbench
Vertex AI Experiments
Autologging.
Learn how to use Vertex AI Autologging.

Tutorial steps

  • Enable autologging in the Vertex AI SDK.
  • Train scikitlearn model and see the resulting experiment run with metrics and parameters autologged to Vertex AI Experiments without setting an experiment run.
  • Train Tensorflow model, check autologged metrics and parameters to Vertex AI Experiments by manually setting an experiment run with aiplatform.start_run() and aiplatform.end_run().
  • Disable autologging in the Vertex AI SDK, train a PyTorch model and check that none of the parameters or metrics are logged.
Colab
GitHub
Vertex AI Workbench
Classification for tabular data
Vertex Explainable AI
AutoML training tabular binary classification model for batch explanation.
Learn to use AutoML to create a tabular binary classification model from a Python script, and then learn to use Vertex AI Batch Prediction to make predictions with explanations. Learn more about Classification for tabular data. Learn more about Vertex Explainable AI.

Tutorial steps

  • Create a Vertex AI Dataset resource.
  • Train an AutoML tabular binary classification model.
  • View the model evaluation metrics for the trained model.
  • Make a batch prediction request with explainability.
Colab
GitHub
Vertex AI Workbench
Classification for tabular data
Vertex Explainable AI
AutoML training tabular classification model for online explanation.
Learn how to use AutoML to create a tabular binary classification model from a Python script, and then learn to use Vertex AI Online Prediction to make online predictions with explanations. Learn more about Classification for tabular data. Learn more about Vertex Explainable AI.

Tutorial steps

  • Create a Vertex AI Dataset resource.
  • Train an AutoML tabular binary classification model.
  • View the model evaluation metrics for the trained model.
  • Create a serving Endpoint resource.
  • Deploy the Model resource to a serving Endpoint resource.
  • Make an online prediction request with explainability.
  • Undeploy the Model resource.
Colab
GitHub
Vertex AI Workbench
Vertex Explainable AI
Vertex AI Batch Prediction
Custom training image classification model for batch prediction with explainabilty.
Learn to use Vertex AI Training and Explainable AI to create a custom image classification model with explanations, and then you learn to use Vertex AI Batch Prediction to make a batch prediction request with explanations. Learn more about Vertex Explainable AI. Learn more about Vertex AI Batch Prediction.

Tutorial steps

  • Create a Vertex AI custom job for training a TensorFlow model.
  • View the model evaluation for the trained model.
  • Set explanation parameters for when the model is deployed.
  • Upload the trained model artifacts and explanation parameters as a Model resource.
  • Make a batch prediction with explanations.