Reader small image

You're reading from  Automated Machine Learning

Product typeBook
Published inFeb 2021
Reading LevelBeginner
PublisherPackt
ISBN-139781800567689
Edition1st Edition
Languages
Right arrow
Author (1)
Adnan Masood
Adnan Masood
author image
Adnan Masood

Adnan Masood, PhD is an artificial intelligence and machine learning researcher, visiting scholar at Stanford AI Lab, software engineer, Microsoft MVP (Most Valuable Professional), and Microsoft's regional director for artificial intelligence. As chief architect of AI and machine learning at UST Global, he collaborates with Stanford AI Lab and MIT CSAIL, and leads a team of data scientists and engineers building artificial intelligence solutions to produce business value and insights that affect a range of businesses, products, and initiatives.
Read more about Adnan Masood

Right arrow

Chapter 9: Automated Machine Learning with GCP

"The first rule of any technology used in a business is that automation applied to an efficient operation will magnify the efficiency. The second is that automation applied to an inefficient operation will magnify the inefficiency."

-Bill Gates

This has been a long yet rewarding journey of learning about major hyperscalers and how they implement automated machine learning in their respective platforms. In the previous chapter, you learned how to get started with Google Cloud AI Platform, learned about AI Hub, and learned how to build a notebook instance in GCP. You also learned about the different flavors of automated machine learning offered by GCP, including AutoML Natural Language, AutoML Tables, AutoML Translation, AutoML Video, and AutoML Vision.

Continuing with the breadth of GCP offerings, capabilities, and services, we will now do a deep dive into Cloud AutoML Tables. We will build models and explain how automated...

Getting started with Google Cloud AutoML Tables

AutoML Tables helps harness the insights in your structured data. In any large enterprise, there are multiple modalities of data, including structured, unstructured, and semi-structured data. For most organizations dealing with databases and transactions, there is indeed a lot of structured data out there. This data is quite suitable for advances analytics, and GCP's AutoML Tables is just the tool to help you automatically build and deploy machine learning models based on structured data.

AutoML Tables enables machine learning engineers and data scientists to automatically build and deploy state-of-the-art machine learning models on structured data faster than anyone could manually do. It automates modeling on a wide range of data types, from numbers and classes to strings, timestamps, lists, and nested fields. Google Cloud AutoML tables make this happen with minimal code. In this chapter, we will learn how to take an exported...

Creating an AutoML Tables experiment

AutoML Tables automatically builds and deploys state-of-the-art machine learning models on structured data. Let's start with our first experiment to put this knowledge into practice:

  1. Access the Google Cloud AI Platform home page by visiting this link: https://console.cloud.google.com/home/. Click on the Datasets link in the left pane; you will see the following screen:

    Figure 9.1 – Google Cloud AI Platform home page

  2. On the Google AutoML Tables main screen, start the process by creating a new dataset. Click on the NEW DATASET button to create a new dataset and name it IrisAutoML. Then, click on CREATE DATASET:

    Figure 9.2 – AutoML Tables – Create new dataset screen

  3. For this experiment, we will start with the Iris dataset. You can download the CSV file from https://www.kaggle.com/uciml/iris since we will be using it in the next step. The dataset is too small to be used for automated machine learning though...

Understanding AutoML Tables model deployment

In order to deploy the model that we trained in the previous section, perform the following steps:

  1. We must click on the TEST & USE tab to deploy the model. There are multiple ways of testing the trained model: you can either test it as a batch prediction (file-based), as an online prediction (API), or export it in a Docker container. The option at the top of the page lets you toggle between online predictions via the REST API and batch predictions. This allows you to upload a CSV file or point to a BigQuery table and get prediction results for that entire file or table. Considering the amount of time it takes to use, AutoML Tables enables you to achieve a much higher level of model performance than you could reach manually. We will be doing online API-based prediction in this section:

    Figure 9.22 – AutoML Tables – exporting the model

  2. Click on the ONLINE PREDICTION tab. You will see the following screen. Here...

AutoML Tables with BigQuery public datasets

Data has been called the new oil of the digital economy. To extend this analogy, automated machine learning is the engine that uses data to provide advanced analytics without custom manual plumbing each time, but I digress. Real-world data for performing machine learning experiments comes from various organizations, though counterparts are needed to perform experiments and try out hypotheses. Such a data repository is the Google BigQuery cloud data warehouse – specifically, its large collection of public datasets. In this example, we will use BigQuery, one of the three methods specified in the data ingestion process for AutoML Tables, for our experiment.

Like the loan dataset we used earlier, the adult income dataset is a public dataset derived from the 1994 United States Census Bureau and uses demographic information to predict the income of two classes: above or below $50,000 per year. The dataset contains 14 attributes, with...

Automated machine learning for price prediction

So far, you have seen how AutoML Tables can be used for classification problems; that is, finding classes in a dataset. Now, let's do some regression; that is, predicting values. To do this, we will use the house sales prediction dataset. The King County house sales dataset contains prices for King County, which includes Seattle. The dataset can be downloaded from Kaggle at https://www.kaggle.com/harlfoxem/housesalesprediction.

For this experiment, our goal is to predict a house's sale value (price) by using 21 features and 21,613 observations or data points:

  1. Let's start in AI Platform by clicking on the CREATE DATASET button on the main page:

    Figure 9.34 – AutoML Tables – getting started with the AI Platform home page

    Here, you must choose a dataset name and region, as shown in the following screenshot. Set the dataset's type to tabular since it currently has classification and regression automated...

Summary

In this chapter, you learned how to perform automated machine learning using AutoML Tables. We started by setting up a Cloud AutoML Tables-based experiment and then demonstrated how the AutoML Tables model is trained and deployed. Using multiple data sources, we explored AutoML Tables with BigQuery public datasets, as well as both classification and regression. We hope that this chapter has made you familiar with working with GCP AutoML so that you can apply it to your automated machine learning experiments.

In the next chapter, we will explore an enterprise use case for automated machine learning.

Further reading

For more information regarding what was covered in this chapter, please refer to the following links:

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Automated Machine Learning
Published in: Feb 2021Publisher: PacktISBN-13: 9781800567689
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Adnan Masood

Adnan Masood, PhD is an artificial intelligence and machine learning researcher, visiting scholar at Stanford AI Lab, software engineer, Microsoft MVP (Most Valuable Professional), and Microsoft's regional director for artificial intelligence. As chief architect of AI and machine learning at UST Global, he collaborates with Stanford AI Lab and MIT CSAIL, and leads a team of data scientists and engineers building artificial intelligence solutions to produce business value and insights that affect a range of businesses, products, and initiatives.
Read more about Adnan Masood