arrow_back

Training an AutoML Classification Model - Structured Data

登录 加入
访问 700 多个实验和课程

Training an AutoML Classification Model - Structured Data

实验 3 个小时 universal_currency_alt 5 积分 show_chart 高级
info 此实验可能会提供 AI 工具来支持您学习。
访问 700 多个实验和课程

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.

准备工作

  1. 实验会创建一个 Google Cloud 项目和一些资源,供您使用限定的一段时间
  2. 实验有时间限制,并且没有暂停功能。如果您中途结束实验,则必须重新开始。
  3. 在屏幕左上角,点击开始实验即可开始

使用无痕浏览模式

  1. 复制系统为实验提供的用户名密码
  2. 在无痕浏览模式下,点击打开控制台

登录控制台

  1. 使用您的实验凭证登录。使用其他凭证可能会导致错误或产生费用。
  2. 接受条款,并跳过恢复资源页面
  3. 除非您已完成此实验或想要重新开始,否则请勿点击结束实验,因为点击后系统会清除您的工作并移除该项目

此内容目前不可用

一旦可用,我们会通过电子邮件告知您

太好了!

一旦可用,我们会通过电子邮件告知您

一次一个实验

确认结束所有现有实验并开始此实验

使用无痕浏览模式运行实验

请使用无痕模式或无痕式浏览器窗口运行此实验。这可以避免您的个人账号与学生账号之间发生冲突,这种冲突可能导致您的个人账号产生额外费用。