A trained BigQuery ML model must score 5 million new customer rows already in BigQuery and write the results to a table. What is the simplest approach?
- Exam domain
- Architecting low-code AI solutions~13% of the exam
- Difficulty
- Easy
- In this mock
- 9 questions on this domainPractise this domain
Why the exam asks this
Objective in the exam guide: Generating predictions by using BigQuery ML.
Scoring in place avoids moving data. The exam checks the function.
Why B is the answer
Run ML.PREDICT on the model with a query over the new rows
ML.PREDICT runs batch inference in SQL where the data lives, and the query result can be saved to a table.
How it works
ML.PREDICT applies a BigQuery ML model to a table or query.
It returns the input columns with predicted values.
Any preprocessing from TRANSFORM is applied automatically.
Clues in the question
The words that point to the answer, and what each one tells you.
- Rows already in BigQuery
- Score in place with SQL.
In detail
- ML.PREDICT returns input columns plus predicted columns.
- Schedule the query for recurring scoring.
Side by side with look-alikes
| Option | Fits batch scoring in BigQuery? |
|---|---|
| ML.PREDICT | Yes |
| Online endpoint per row | No |
| Retrain | Does not predict |
| Notebook by hand | No |
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Copy the rows into a notebook and score them by handWrong
Manual notebook scoring adds data movement.
B. Run ML.PREDICT on the model with a query over the new rowsRight
ML.PREDICT runs batch inference in SQL where the data lives, and the query result can be saved to a table.
C. Export the model and call an online endpoint for each rowWrongMost tempting
Per-row online calls add latency, cost and code for a batch job.
Why it tempts: Endpoints serve predictions too. But a large table is a batch job, and per-row calls are slow and costly.
D. Retrain the model on the new rowsWrong
Retraining does not produce predictions for the rows.
In practice
- Wrap ML.PREDICT in CREATE TABLE AS SELECT to persist scores.