Machine Learning with BigQuery ML

Book description

Manage different business scenarios with the right machine learning technique using Google's highly scalable BigQuery ML

Key Features

  • Gain a clear understanding of AI and machine learning services on GCP, learn when to use these, and find out how to integrate them with BigQuery ML
  • Leverage SQL syntax to train, evaluate, test, and use ML models
  • Discover how BigQuery works and understand the capabilities of BigQuery ML using examples

Book Description

BigQuery ML enables you to easily build machine learning (ML) models with SQL without much coding. This book will help you to accelerate the development and deployment of ML models with BigQuery ML.

The book starts with a quick overview of Google Cloud and BigQuery architecture. You'll then learn how to configure a Google Cloud project, understand the architectural components and capabilities of BigQuery, and find out how to build ML models with BigQuery ML. The book teaches you how to use ML using SQL on BigQuery. You'll analyze the key phases of a ML model's lifecycle and get to grips with the SQL statements used to train, evaluate, test, and use a model. As you advance, you'll build a series of use cases by applying different ML techniques such as linear regression, binary and multiclass logistic regression, k-means, ARIMA time series, deep neural networks, and XGBoost using practical use cases. Moving on, you'll cover matrix factorization and deep neural networks using BigQuery ML's capabilities. Finally, you'll explore the integration of BigQuery ML with other Google Cloud Platform components such as AI Platform Notebooks and TensorFlow along with discovering best practices and tips and tricks for hyperparameter tuning and performance enhancement.

By the end of this BigQuery book, you'll be able to build and evaluate your own ML models with BigQuery ML.

What you will learn

  • Discover how to prepare datasets to build an effective ML model
  • Forecast business KPIs by leveraging various ML models and BigQuery ML
  • Build and train a recommendation engine to suggest the best products for your customers using BigQuery ML
  • Develop, train, and share a BigQuery ML model from previous parts with AI Platform Notebooks
  • Find out how to invoke a trained TensorFlow model directly from BigQuery
  • Get to grips with BigQuery ML best practices to maximize your ML performance

Who this book is for

This book is for data scientists, data analysts, data engineers, and anyone looking to get started with Google's BigQuery ML. You'll also find this book useful if you want to accelerate the development of ML models or if you are a business user who wants to apply ML in an easy way using SQL. Basic knowledge of BigQuery and SQL is required.

Table of contents

  1. Machine Learning with BigQuery ML
  2. Contributors
  3. About the author
  4. About the reviewers
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Code in Action
    6. Download the color images
    7. Conventions used
    8. Get in touch
    9. Reviews
  6. Section 1: Introduction and Environment Setup
  7. Chapter 1: Introduction to Google Cloud and BigQuery
    1. Introducing Google Cloud Platform
      1. Interacting with GCP
      2. Discovering GCP's key differentiators
    2. Exploring AI and ML services on GCP
      1. Core platform services
      2. Building blocks
      3. Solutions
    3. Introducing BigQuery
      1. BigQuery architecture
      2. BigQuery's advantages over traditional data warehouses
      3. Interacting with BigQuery
      4. BigQuery data structures
    4. Discovering BigQuery ML
      1. BigQuery ML benefits
      2. BigQuery ML algorithms
    5. Understanding BigQuery pricing
      1. BigQuery pricing
      2. BigQuery ML pricing
      3. Free operations and free tiers
      4. Pricing calculator
    6. Summary
    7. Further resources
  8. Chapter 2: Setting Up Your GCP and BigQuery Environment
    1. Technical requirements
    2. Creating your GCP account and project
      1. Registering a GCP account
      2. Exploring Google Cloud Console
      3. Creating a GCP project
    3. Activating BigQuery
    4. Discovering the BigQuery web UI
    5. Exploring the BigQuery public datasets
      1. Searching for a public dataset
      2. Analyzing a table
    6. Summary
    7. Further reading
  9. Chapter 3: Introducing BigQuery Syntax
    1. Technical requirements
    2. Creating a BigQuery dataset
    3. Discovering BigQuery SQL
      1. CRUD operations
    4. Diving into BigQuery ML
    5. Summary
    6. Further resources
  10. Section 2: Deep Learning Networks
  11. Chapter 4: Predicting Numerical Values with Linear Regression
    1. Technical requirements
    2. Introducing the business scenario
    3. Discovering linear regression
    4. Exploring and understanding the dataset
      1. Understanding the data
      2. Checking the data's quality
      3. Segmenting the dataset
    5. Training the linear regression model
    6. Evaluating the linear regression model
    7. Utilizing the linear regression model
    8. Drawing business conclusions
    9. Summary
    10. Further reading
  12. Chapter 5: Predicting Boolean Values Using Binary Logistic Regression
    1. Technical requirements
    2. Introducing the business scenario
    3. Discovering binary logistic regression
    4. Exploring and understanding the dataset
      1. Understanding the data
      2. Segmenting the dataset
    5. Training the binary logistic regression model
    6. Evaluating the binary logistic regression model
    7. Using the binary logistic regression model
    8. Drawing business conclusions
    9. Summary
    10. Further resources
  13. Chapter 6: Classifying Trees with Multiclass Logistic Regression
    1. Technical requirements
    2. Introducing the business scenario
    3. Discovering multiclass logistic regression
    4. Exploring and understanding the dataset
      1. Understanding the data
      2. Checking the data quality
      3. Segmenting the dataset
    5. Training the multiclass logistic regression model
    6. Evaluating the multiclass logistic regression model
    7. Using the multiclass logistic regression model
    8. Drawing business conclusions
    9. Summary
    10. Further resources
  14. Section 3: Advanced Models with BigQuery ML
  15. Chapter 7: Clustering Using the K-Means Algorithm
    1. Technical requirements
    2. Introducing the business scenario
    3. Discovering K-Means clustering
    4. Exploring and understanding the dataset
      1. Understanding the data
      2. Checking the data quality
      3. Creating the training datasets
    5. Training the K-Means clustering model
    6. Evaluating the K-Means clustering model
    7. Using the K-Means clustering model
    8. Drawing business conclusions
    9. Summary
    10. Further resources
  16. Chapter 8: Forecasting Using Time Series
    1. Technical requirements
    2. Introducing the business scenario
    3. Discovering time series forecasting
    4. Exploring and understanding the dataset
      1. Understanding the data
      2. Checking the data quality
      3. Creating the training dataset
    5. Training the time series forecasting model
    6. Evaluating the time series forecasting model
    7. Using the time series forecasting model
    8. Presenting the forecast
    9. Summary
    10. Further resources
  17. Chapter 9: Suggesting the Right Product by Using Matrix Factorization
    1. Technical requirements
    2. Introducing the business scenario
    3. Discovering matrix factorization
    4. Configuring BigQuery Flex Slots
    5. Exploring and preparing the dataset
      1. Understanding the data
      2. Creating the training dataset
    6. Training the matrix factorization model
    7. Evaluating the matrix factorization model
    8. Using the matrix factorization model
    9. Drawing business conclusions
    10. Summary
    11. Further resources
  18. Chapter 10: Predicting Boolean Values Using XGBoost
    1. Technical requirements
    2. Introducing the business scenario
    3. Discovering the XGBoost Boosted Tree classification model
    4. Exploring and understanding the dataset
      1. Checking the data quality
      2. Segmenting the dataset
    5. Training the XGBoost classification model
    6. Evaluating the XGBoost classification model
    7. Using the XGBoost classification model
    8. Drawing business conclusions
    9. Summary
    10. Further resources
  19. Chapter 11: Implementing Deep Neural Networks
    1. Technical requirements
    2. Introducing the business scenario
    3. Discovering DNNs
      1. DNNs in BigQuery ML
    4. Preparing the dataset
    5. Training the DNN models
    6. Evaluating the DNN models
    7. Using the DNN models
    8. Drawing business conclusions
      1. Deep neural networks versus linear models
    9. Summary
    10. Further resources
  20. Section 4: Further Extending Your ML Capabilities with GCP
  21. Chapter 12: Using BigQuery ML with AI Notebooks
    1. Technical requirements
    2. Discovering AI Platform Notebooks
      1. AI Platform Notebooks pricing
      2. Configuring the first notebook
    3. Implementing BigQuery ML models within notebooks
      1. Compiling the AI notebook
      2. Running the code in the AI notebook
    4. Summary
    5. Further resources
  22. Chapter 13: Running TensorFlow Models with BigQuery ML
    1. Technical requirements
    2. Introducing TensorFlow
    3. Discovering the relationship between BigQuery ML and TensorFlow
      1. Understanding commonalities and differences
      2. Collaborating with BigQuery ML and TensorFlow
    4. Converting BigQuery ML models into TensorFlow
      1. Training the BigQuery ML to export it
      2. Exporting the BigQuery ML model
    5. Running TensorFlow models with BigQuery ML
    6. Summary
    7. Further resources
  23. Chapter 14: BigQuery ML Tips and Best Practices
    1. Choosing the right BigQuery ML algorithm
    2. Preparing the datasets
      1. Working with high-quality data
      2. Segmenting the datasets
    3. Understanding feature engineering
    4. Tuning hyperparameters
    5. Using BigQuery ML for online predictions
    6. Summary
    7. Further resources
    8. Why subscribe?
  24. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Leave a review - let other readers know what you think

Product information

  • Title: Machine Learning with BigQuery ML
  • Author(s): Alessandro Marrandino
  • Release date: June 2021
  • Publisher(s): Packt Publishing
  • ISBN: 9781800560307