PMLE · LESSON 1

Section 1: Architecting low-code AI solutions約13% · 2 topics

Learn low-code model building with BigQuery ML and AutoML, and choosing and optimizing models from Model Garden, industry APIs and generative AI.

1.1Building models with BigQuery ML and AutoML

Building models with BigQuery ML and Agent Platform AutoML (classification, regression, forecasting, clustering), feature engineering and prediction in BigQuery ML, and fine-tuning Gemini from BigQuery

Concept

BigQuery ML lets you build models inside BigQuery with the SQL CREATE MODEL statement, so you can do classification (logistic regression, boosted trees), regression, time-series forecasting (ARIMA_PLUS), clustering (k-means) and more without moving data. Preprocessing defined in the TRANSFORM clause is applied automatically at prediction time too. Predict with ML.PREDICT and evaluate with ML.EVALUATE. Agent Platform AutoML builds high-quality models from tabular, image, text and other data with very little code. You can also call and tune Gemini models from BigQuery.

How it works / steps

  1. If the data is in BigQuery and you want to stay in SQL, use BigQuery ML
  2. Write preprocessing in the TRANSFORM clause to keep training and prediction consistent
  3. For accuracy with little effort, use AutoML
  4. Evaluate with ML.EVALUATE and predict with ML.PREDICT

Workplace example

An analyst builds an ARIMA_PLUS model in SQL on a BigQuery sales table and forecasts next month's sales for each store.

Common confusions and exam tips

Mini quiz

Q1. Which function makes predictions with a model trained in BigQuery ML?

  1. EXPORT DATA PREDICT
  2. ML.PREDICT
  3. CREATE PREDICTION TABLE
  4. ML.TRAIN_ALL_ROWS
Show answer and explanation

Answer: B ML.PREDICT

Train with CREATE MODEL, evaluate with ML.EVALUATE, predict with ML.PREDICT.

Q2. What is the most appropriate advantage of BigQuery ML's TRANSFORM clause?

  1. It automatically decides and adds the number of GPUs needed for training
  2. It automatically moves training data to Cloud Storage to speed processing
  3. It automatically applies the same preprocessing at training and prediction
  4. It converts SQL queries to Python code and runs them in notebooks
Show answer and explanation

Answer: C It automatically applies the same preprocessing at training and prediction

Preprocessing defined in TRANSFORM is saved with the model and applied at prediction too, preventing skew.

Reference links

1.2Choosing and optimizing models from Model Garden, industry APIs and generative AI

Evaluating and choosing models from Model Garden, industry APIs (Document AI, Vision, Translation), tuning Gemini, Imagen, Veo and MaaS models, and optimizing cost, latency and availability of Gemini apps

Concept

Model Garden is a catalog for evaluating and deploying models from Google (Gemini, Imagen, Veo), partners and open models (such as Gemma), and also offers MaaS (Model as a Service) for using models as APIs. Routine tasks can often be solved with pretrained APIs such as Document AI (document parsing), Vision API (images) and Translation API (translation). Gemini apps optimize cost, latency and availability through model size choice, context caching, batch prediction, provisioned throughput and more.

How it works / steps

  1. First check whether a pretrained API meets the requirements
  2. Compare candidate models in Model Garden on evaluation data
  3. If needed, align output with tuning (such as supervised tuning)
  4. Choose model size and delivery method to fit cost and latency

Workplace example

Invoices are processed by extracting fields with a pretrained Document AI processor, and inquiry summaries are handled cheaply with a lightweight Gemini model and batch prediction.

Common confusions and exam tips

Mini quiz

Q1. What is the most appropriate way to use Gemini models in BigQuery?

  1. Export BigQuery data to CSV each time and paste it into prompts by hand
  2. BigQuery can't handle generative AI models at all, so move to another database
  3. Store Gemini's model weights in a BigQuery table and compute directly
  4. Create a remote model and call it from SQL with generation functions
Show answer and explanation

Answer: D Create a remote model and call it from SQL with generation functions

With remote models and ML.GENERATE_TEXT and the like, you can use Gemini from SQL. Tuning Gemini from BigQuery is also possible.

Q2. When is it most appropriate to fine-tune Gemini using BigQuery?

  1. Training examples are in BigQuery and you want to tune while staying in SQL
  2. You want responses in a fixed format, returned reliably as JSON
  3. You want answers based on searching internal documents
  4. You want daily answers to reflect news the model does not know
Show answer and explanation

Answer: A Training examples are in BigQuery and you want to tune while staying in SQL

Reflecting the latest information suits grounding and RAG. [Other options] Fresh information and internal documents call for grounding or RAG. Format can be controlled with prompts or structured output.

Reference links

Lessons are written by this site based on public information and do not guarantee exam content. Product specifications change, so check the latest information at the reference links.

Notes (unofficial, original questions, no pass guarantee)