arrow_back

Training an AutoML Classification Model - Structured Data

Accedi Partecipa
Accedi a oltre 700 lab e corsi

Training an AutoML Classification Model - Structured Data

Lab 3 ore universal_currency_alt 5 crediti show_chart Avanzati
info Questo lab potrebbe incorporare strumenti di AI a supporto del tuo apprendimento.
Accedi a oltre 700 lab e corsi

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.

Prima di iniziare

  1. I lab creano un progetto e risorse Google Cloud per un periodo di tempo prestabilito
  2. I lab hanno un limite di tempo e non possono essere messi in pausa. Se termini il lab, dovrai ricominciare dall'inizio.
  3. In alto a sinistra dello schermo, fai clic su Inizia il lab per iniziare

Utilizza la navigazione privata

  1. Copia il nome utente e la password forniti per il lab
  2. Fai clic su Apri console in modalità privata

Accedi alla console

  1. Accedi utilizzando le tue credenziali del lab. L'utilizzo di altre credenziali potrebbe causare errori oppure l'addebito di costi.
  2. Accetta i termini e salta la pagina di ripristino delle risorse
  3. Non fare clic su Termina lab a meno che tu non abbia terminato il lab o non voglia riavviarlo, perché il tuo lavoro verrà eliminato e il progetto verrà rimosso

Questi contenuti non sono al momento disponibili

Ti invieremo una notifica via email quando sarà disponibile

Bene.

Ti contatteremo via email non appena sarà disponibile

Un lab alla volta

Conferma per terminare tutti i lab esistenti e iniziare questo

Utilizza la navigazione privata per eseguire il lab

Utilizza una finestra del browser in incognito o privata per eseguire questo lab. In questo modo eviterai eventuali conflitti tra il tuo account personale e l'account Studente, che potrebbero causare addebiti aggiuntivi sul tuo account personale.