This page describes how to evaluate models using Vertex AI. For an overview, see model evaluation in Vertex AI.
Prerequisites
Follow the steps at Set up a project and a development environment. In addition, enable the following services:
Vertex AI can evaluate models that are trained either through AutoML or custom training. For the Google Cloud console guide, you should have a trained model imported to Vertex AI Model Registry.
Upload your test dataset to BigQuery or Cloud Storage. The test dataset should contain the ground truth, which is the actual result expected for a prediction. Obtain the link to the file or the dataset ID.
Have a batch prediction output in the form of a BigQuery table or Cloud Storage URI.
Make sure your default Compute Engine service account has the following IAM permissions:
- Vertex AI Administrator (
aiplatform.admin
) - Vertex AI Service Agent (
aiplatform.serviceAgent
) - Storage Object Admin (
storage.objectAdmin
) - Dataflow Worker (
dataflow.worker
) - BigQuery Data Editor (
bigquery.dataEditor
) (only required if you are providing data in the form of BigQuery tables)
- Vertex AI Administrator (
Create an evaluation
Console
In the Google Cloud console, go to the Vertex AI Models page.
Click the name of the model you want to evaluate.
Click the version number for the model.
On the Evaluate tab, click Create Evaluation.
Enter an Evaluation name.
Select an Objective, such as classification or regression.
Enter the Evaluation target column name, which is the column from the training data that the model is trained to predict.
For Select source, select the source for your test dataset.
For BigQuery table, enter the BigQuery path.
For File on Cloud Storage, enter the Cloud Storage path.
For Batch prediction output, select an output format.
- Enter the BigQuery path or Cloud Storage URI.
Click Start Evaluation.
Python
To view the Vertex AI API model evaluation workflow in Vertex AI Pipelines, see the example notebooks for the following model types:
Python SDK
The SDK for evaluating models with Vertex AI is in Experimental. To sign up for the Experimental, fill out the onboarding form.
Vertex AI automatically sends an email notification when a model evaluation job is complete.
View evaluation metrics
Console
In the Google Cloud console, go to the Vertex AI Models page.
Navigate to the model version.
View metrics in the Evaluate tab.
Python
To view the Vertex AI API model evaluation workflow in Vertex AI Pipelines, see the example notebooks for the following model types:
Python SDK
The SDK for evaluating models with Vertex AI is in Experimental. To sign up for the Experimental, fill out the onboarding form.
Compare evaluation metrics
You can compare evaluation results across different models, model versions, and evaluation jobs. For more information about model versioning, see Versioning in Model Registry.
You can only compare models of the same type, such as classification, regression, or forecasting. When comparing different models, all the model versions must be the same type.
You can only compare 5 or fewer evaluations at a time.
Go to the Vertex AI Model Registry in the Google Cloud console:
Navigate to your model or model version:
To compare across different models on the Models page, select the checkboxes next to the names of the models you want to compare.
To compare across different model versions:
Click on the name of your model on the Models page to open the list of model versions.
Select the checkboxes next to the versions you want to compare.
To compare across evaluation jobs for the same model version:
Click on the name of your model on the Models page to open the list of model versions.
Click on the version number.
Select the checkboxes next to the evaluation jobs you want to compare.
Click Compare.
What's next
- Learn how to iterate on your model.