arrow_back

Training an AutoML Classification Model - Structured Data

Get access to 700+ labs and courses

Training an AutoML Classification Model - Structured Data

Lab 3 год universal_currency_alt 5 кредитів show_chart Поглиблений
info This lab may incorporate AI tools to support your learning.
Get access to 700+ labs and courses

Overview

In this lab, you create a tabular dataset using Vertex AI and use it to train a classification model.

Learning objectives

  • Create a dataset and train an AutoML classification model.
  • Deploy a model and request a prediction.

Introduction to Vertex AI

This lab uses the newest AI product offering available on Google Cloud. Vertex AI integrates the ML offerings across Google Cloud into a seamless development experience. Previously, models trained with AutoML and custom models were accessible via separate services. The new offering combines both into a single API, along with other new products. You can also migrate existing projects to Vertex AI. If you have any feedback, please refer to the support page.

Vertex AI includes many different products to support end-to-end ML workflows. This lab focuses on the products highlighted below: Training/HP-Tuning and Notebooks.

A graph displaying the various products offered by Vertex AI, with Training and Notebooks highlighted.

Setup

For each lab, you get a new Google Cloud project and set of resources for a fixed time at no cost.

  1. Sign in to Qwiklabs using an incognito window.

  2. Note the lab's access time (for example, 1:15:00), and make sure you can finish within that time.
    There is no pause feature. You can restart if needed, but you have to start at the beginning.

  3. When ready, click Start lab.

  4. Note your lab credentials (Username and Password). You will use them to sign in to the Google Cloud Console.

  5. Click Open Google Console.

  6. Click Use another account and copy/paste credentials for this lab into the prompts.
    If you use other credentials, you'll receive errors or incur charges.

  7. Accept the terms and skip the recovery resource page.

Task 1. Enable the Vertex AI API

  1. In the Google Cloud Console, on the Navigation menu, click Vertex AI.

  2. Click Enable All Recommended API.

Task 2. Create a dataset and training an AutoML classification model

Create a tabular dataset

  1. In the Vertex AI console, on the Dashboard page, click Create dataset.

  2. For the dataset name, type Structured_AutoML_Tutorial

  3. For data type and objective, select Tabular.

  4. Accept the defaults and click Create.

  5. For Select a data source, select Select CSV files from Cloud Storage, and for Import file path, type cloud-training/mlongcp/v3.0_MLonGC/toy_data/bank-marketing_toy.csv

  6. Click Continue.

The Analyze pane opens.

  1. Click Generate statistics.

It will take few minutes to generate statistics.

When the statistics are generated, you can click on any feature to see more details about the data for that feature.

Train an AutoML classification model

  1. Click Train new model and select Other.

  2. In the Train new model pane, for Objective, select Classification.

  3. Select the AutoML training method, and click Continue.

  4. For Target column, select Deposit, and click Continue.

The list of columns is displayed with the transformation that will be used for each feature.

  1. To display the Compute and pricing pane, click Continue.

  2. For Budget, type 1

  3. Click Start training.

The training budget determines actual training time, but the time to complete training includes other activities, so the entire process can take about two hours. When the model finishes training it is displayed in the Model Registry pane as a live link with a green checkmark status icon.

Note: It takes nearly 2 hours to complete the training. Please wait till the training get completed.

Task 3. Deploy a model and requesting a prediction

Deploy your model to an endpoint

  1. In the Vertex AI console, in the navigation pane, click Model Registry.

  2. Click on your Model name and then click on your Version ID to open its Evaluate pane.
    This panel displays quality metrics for the model, including a confusion matrix.

  3. To see evaluation metrics for a value, select that value for the target column.

The effect of each column on model training (feature importance) is displayed.

  1. In the Deploy & test pane, under Deploy your model, click Deploy to endpoint.

  2. For Endpoint name, type Structured_AutoML_Tutorial and click Continue.

  3. On Model settings page, for Explainability option enable the Enable feature attributions for this model.

  4. Click Done, and click Continue.

  5. On Model monitoring page review the default settings and click Continue.

  6. For Training data source, select Vertex AI dataset and choose your dataset from the dropdown.

  7. For Target column type Deposit.

  8. Under Alert thresholds enable the toggle to train model that are configured to have attribution scrores through Explainable AI.

  9. To create your endpoint and deploy your model to it, click Deploy.

Deploying a model can take several minutes.

Request a prediction

While the endpoint is being created, you can optionally enter a set of values for a prediction.

  1. Return to the Models list in the navigation pane and open your newly created model.

  2. Open the Deploy & test pane.

You can use the prefilled values for the prediction data or enter your own.

  1. When the model is deployed, click Predict.

For this model, a prediction result of 1 represents a negative outcome: a deposit is not made at the bank. A prediction result of 2 represents a positive outcome: a deposit is made at the bank.

If you used the pre-filled prediction values, the local feature importance values are all zero. This is because the pre-filled values are the baseline prediction data, so the prediction returned is the baseline prediction value.

End your lab

When you have completed your lab, click End Lab. Qwiklabs removes the resources you’ve used and cleans the account for you.

You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.

The number of stars indicates the following:

  • 1 star = Very dissatisfied
  • 2 stars = Dissatisfied
  • 3 stars = Neutral
  • 4 stars = Satisfied
  • 5 stars = Very satisfied

You can close the dialog box if you don't want to provide feedback.

For feedback, suggestions, or corrections, please use the Support tab.

Copyright 2022 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.

Before you begin

  1. Labs create a Google Cloud project and resources for a fixed time
  2. Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
  3. On the top left of your screen, click Start lab to begin

Use private browsing

  1. Copy the provided Username and Password for the lab
  2. Click Open console in private mode

Sign in to the Console

  1. Sign in using your lab credentials. Using other credentials might cause errors or incur charges.
  2. Accept the terms, and skip the recovery resource page
  3. Don't click End lab unless you've finished the lab or want to restart it, as it will clear your work and remove the project

This content is not currently available

We will notify you via email when it becomes available

Great!

We will contact you via email if it becomes available

One lab at a time

Confirm to end all existing labs and start this one

Use private browsing to run the lab

Use an Incognito or private browser window to run this lab. This prevents any conflicts between your personal account and the Student account, which may cause extra charges incurred to your personal account.