Stay organized with collections
Save and categorize content based on your preferences.
This tutorial is a start-to-finish guide that shows you how to use the
Vertex AI SDK for Python to create a custom-trained model. You run code in a
notebook (IPYNB) file that uses a Docker container to train and create the
model. The tutorial is for data scientists who are new to Vertex AI and
familiar with notebooks, Python, and the Machine Learning (ML) workflow.
The process starts using the Google Cloud console to create the project that
contains your work. In your project, you use Vertex AI Workbench to
create a Jupyter notebook. The notebook environment is where you run code
that downloads and prepares a dataset, then use the dataset to create and train
a model. At the end of the tutorial, the trained model generates predictions.
The goal of this tutorial is to walk you through every step required to create
predictions in less than an hour. The dataset used is relatively small so that it
doesn't take very long to train your model. When you're done, you can apply what
you learn to larger datasets. The larger your dataset is, the more accurate your
predictions are.
Tutorial steps
Prerequisites - Create your Google Cloud
account and project.
Create a
notebook -
Create and prepare a Jupyter notebook and its environment. You use the
notebook to run code that creates your dataset, creates and trains your
model, and generates your predictions.
Create a dataset - Download a publicly
available BigQuery dataset, then use it to create a Vertex AI
tabular dataset. The dataset contains the data you use to train your model.
Create a training script - Create
a Python script that you pass to your training job. The script runs when the
training job trains and creates your model.
Train a model - Use your tabular
dataset to train and deploy a model. You use the model to create your
predictions.
Make predictions - Use your model to
create predictions. This section also walks you through deleting resources
you create while running this tutorial so you don't incur unnecessary
charges.
What you accomplish
This tutorial walks you through how to use the Vertex AI SDK for Python to do the
following:
Create a Cloud Storage bucket to store a dataset
Preprocess data for training
Use the processed data to create a dataset in BigQuery
Use the BigQuery dataset to create a Vertex AI tabular
dataset
Create and train a custom-trained model
Deploy the custom-trained model to an endpoint
Generate a prediction
Undeploy the model
Delete all resources created in the tutorial so you don't incur further
charges
Billable resources used
This tutorial uses billable resources associated with the Vertex AI,
BigQuery, and Cloud Storage Google Cloud services. If you're
new to Google Cloud, you might be able to use one or more of these services at
no cost. Vertex AI offers $300 in free credits to new customers, and
Cloud Storage and BigQuery have free
tiers. For more information, see the following:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[],[],null,["# Train a model using Vertex AI and the Python SDK\n\n| This tutorial takes between 30 and 60 minutes to complete.\n\n\u003cbr /\u003e\n\nThis tutorial is a start-to-finish guide that shows you how to use the\nVertex AI SDK for Python to create a custom-trained model. You run code in a\nnotebook (IPYNB) file that uses a Docker container to train and create the\nmodel. The tutorial is for data scientists who are new to Vertex AI and\nfamiliar with notebooks, Python, and the Machine Learning (ML) workflow.\n\nThe process starts using the Google Cloud console to create the project that\ncontains your work. In your project, you use Vertex AI Workbench to\ncreate a Jupyter notebook. The notebook environment is where you run code\nthat downloads and prepares a dataset, then use the dataset to create and train\na model. At the end of the tutorial, the trained model generates predictions.\n\nThe goal of this tutorial is to walk you through every step required to create\npredictions in less than an hour. The dataset used is relatively small so that it\ndoesn't take very long to train your model. When you're done, you can apply what\nyou learn to larger datasets. The larger your dataset is, the more accurate your\npredictions are.\n\nTutorial steps\n--------------\n\n1. [Prerequisites](/vertex-ai/docs/tutorials/tabular-bq-prediction/prerequisites) - Create your Google Cloud\n account and project.\n\n2. [Create a\n notebook](/vertex-ai/docs/tutorials/tabular-bq-prediction/create-notebook) -\n Create and prepare a Jupyter notebook and its environment. You use the\n notebook to run code that creates your dataset, creates and trains your\n model, and generates your predictions.\n\n3. [Create a dataset](/vertex-ai/docs/tutorials/tabular-bq-prediction/create-dataset) - Download a publicly\n available BigQuery dataset, then use it to create a Vertex AI\n tabular dataset. The dataset contains the data you use to train your model.\n\n4. [Create a training script](/vertex-ai/docs/tutorials/tabular-bq-prediction/create-training-script) - Create\n a Python script that you pass to your training job. The script runs when the\n training job trains and creates your model.\n\n5. [Train a model](/vertex-ai/docs/tutorials/tabular-bq-prediction/train-and-deploy-model) - Use your tabular\n dataset to train and deploy a model. You use the model to create your\n predictions.\n\n6. [Make predictions](/vertex-ai/docs/tutorials/tabular-bq-prediction/make-prediction) - Use your model to\n create predictions. This section also walks you through deleting resources\n you create while running this tutorial so you don't incur unnecessary\n charges.\n\nWhat you accomplish\n-------------------\n\nThis tutorial walks you through how to use the Vertex AI SDK for Python to do the\nfollowing:\n\n- Create a Cloud Storage bucket to store a dataset\n- Preprocess data for training\n- Use the processed data to create a dataset in BigQuery\n- Use the BigQuery dataset to create a Vertex AI tabular dataset\n- Create and train a custom-trained model\n- Deploy the custom-trained model to an endpoint\n- Generate a prediction\n- Undeploy the model\n- Delete all resources created in the tutorial so you don't incur further charges\n\nBillable resources used\n-----------------------\n\nThis tutorial uses billable resources associated with the Vertex AI,\nBigQuery, and Cloud Storage Google Cloud services. If you're\nnew to Google Cloud, you might be able to use one or more of these services at\nno cost. Vertex AI offers $300 in free credits to new customers, and\nCloud Storage and BigQuery have [free\ntiers](https://cloud.google.com/free). For more information, see the following:\n\n- [Vertex AI pricing](/vertex-ai/pricing) and [Free cloud features and trial offer](https://cloud.google.com/free/docs/free-cloud-features#free-trial)\n- [BigQuery pricing](/bigquery/pricing) and [BigQuery free tier usage](https://cloud.google.com/free/docs/free-cloud-features?#bigquery)\n- [Cloud Storage pricing](/storage/pricing) and [Cloud Storage free tier usage](https://cloud.google.com/free/docs/free-cloud-features#storage)\n- [Google Cloud pricing calculator](/products/calculator)\n\nTo prevent further charges, the final step of this tutorial walks you\nthrough removing all billable Google Cloud resources you created."]]