Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Machine Learning with BigQuery ML

You're reading from   Machine Learning with BigQuery ML Create, execute, and improve machine learning models in BigQuery using standard SQL queries

Arrow left icon
Product type Paperback
Published in Jun 2021
Publisher Packt
ISBN-13 9781800560307
Length 344 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Alessandro Marrandino Alessandro Marrandino
Author Profile Icon Alessandro Marrandino
Alessandro Marrandino
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Preface 1. Section 1: Introduction and Environment Setup
2. Chapter 1: Introduction to Google Cloud and BigQuery FREE CHAPTER 3. Chapter 2: Setting Up Your GCP and BigQuery Environment 4. Chapter 3: Introducing BigQuery Syntax 5. Section 2: Deep Learning Networks
6. Chapter 4: Predicting Numerical Values with Linear Regression 7. Chapter 5: Predicting Boolean Values Using Binary Logistic Regression 8. Chapter 6: Classifying Trees with Multiclass Logistic Regression 9. Section 3: Advanced Models with BigQuery ML
10. Chapter 7: Clustering Using the K-Means Algorithm 11. Chapter 8: Forecasting Using Time Series 12. Chapter 9: Suggesting the Right Product by Using Matrix Factorization 13. Chapter 10: Predicting Boolean Values Using XGBoost 14. Chapter 11: Implementing Deep Neural Networks 15. Section 4: Further Extending Your ML Capabilities with GCP
16. Chapter 12: Using BigQuery ML with AI Notebooks 17. Chapter 13: Running TensorFlow Models with BigQuery ML 18. Chapter 14: BigQuery ML Tips and Best Practices 19. Other Books You May Enjoy

Drawing business conclusions

Using the results that we got from the previous section, Using the multiclass logistic regression model, we'll draw some conclusions about the effectiveness of our ML model.

Enriching the previous query with a parent SELECT COUNT statement, we can count how many predictions are right compared to the total number of records.

Let's execute the following query to calculate how often our BigQuery ML model is able to correctly classify the trees in the classification_table table:

SELECT COUNT(*)
FROM (
      SELECT
        tree_id,
        actual_label,
        predicted_label_probs,
        predicted_label
      FROM
        ML.PREDICT (MODEL `06_nyc_trees.classification_model_version_3...
lock icon The rest of the chapter is locked
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.
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 €18.99/month. Cancel anytime