Professional Machine Learning Engineer · Domain 1: Architecting low-code AI solutions · 13% of the exam
Task 1.1: Developing ML models using BigQuery ML or AutoML on Gemini Enterprise Agent Platform.
Choosing a BigQuery ML or Agent Platform AutoML model type for classification, regression, forecasting or clustering, feature engineering and selection in BigQuery ML, generating predictions with SQL, training AutoML models, and fine-tuning Gemini from BigQuery.
Study it
Choosing a BigQuery ML or AutoML model: classification, regression, ARIMA_PLUS forecasting and k-means
Try each one before opening the answer. Every option is explained, with the Google Cloud documentation page that proves it.
Question 1 · choose 1
A grocery chain keeps three years of daily unit sales for 18,000 store-and-product combinations in a BigQuery table. Its analysts work only in SQL and need a 28-day forecast for every combination each week, written back to BigQuery. Sales spike around national holidays, and the team does not want to maintain one model definition per combination. What should the ML engineer recommend?
AA boosted tree regression model in BigQuery ML, trained on lag, trend and holiday features that the analysts build in SQL for each store and product
BAn Agent Platform AutoML forecasting model trained from a Python notebook, with its forecasts exported to BigQuery after each run
CA separate ARIMA_PLUS model per combination, created by a scheduled script that loops over the pairs and calls ML.FORECAST on each
DOne ARIMA_PLUS model with TIME_SERIES_ID_COL on store and product and HOLIDAY_REGION set, with every series read through ML.FORECAST
Show the answer and why
AA boosted tree regression model in BigQuery ML, trained on lag, trend and holiday features that the analysts build in SQL for each store and product
Incorrect
A regression model needs the lag, trend and holiday features to be engineered by hand, which ARIMA_PLUS handles itself for each series.
BAn Agent Platform AutoML forecasting model trained from a Python notebook, with its forecasts exported to BigQuery after each run
Incorrect
AutoML forecasting can do this, but it moves the work out of SQL into a notebook workflow the analysts do not use.
CA separate ARIMA_PLUS model per combination, created by a scheduled script that loops over the pairs and calls ML.FORECAST on each
Incorrect
This gives 18,000 model definitions to maintain, which the team ruled out; TIME_SERIES_ID_COL fits them all in one statement.
DOne ARIMA_PLUS model with TIME_SERIES_ID_COL on store and product and HOLIDAY_REGION set, with every series read through ML.FORECAST
Correct
A single CREATE MODEL statement fits a separate time series pipeline for every ID, models holiday effects for the region, and ML.FORECAST returns the horizon as a table the analysts can query.
The ARIMA_PLUS model in BigQuery ML handles seasonality and holidays automatically. With TIME_SERIES_ID_COL, one query trains and forecasts up to 100,000,000 time series in parallel, and HOLIDAY_REGION adds the holiday effects of the chosen region. ML.FORECAST then returns the forecast for the horizon as rows in BigQuery.
A payments company trains an Agent Platform AutoML tabular classification model to flag fraudulent transactions, which are about 0.3% of the data. Compliance requires the model to catch at least 90% of fraud, and within that limit the investigators want as few false alarms as possible. Which optimization objective should the ML engineer choose?
APrecision at Recall, with its recall value set to the required 0.9
BAUC ROC, the default objective for binary classification
CAUC PR, to focus the model on the less common class
DLog loss, to keep the predicted probabilities accurate
Show the answer and why
APrecision at Recall, with its recall value set to the required 0.9
Correct
This objective optimizes precision at a specific recall value, which is exactly the fixed-recall, fewest-false-alarms requirement.
BAUC ROC, the default objective for binary classification
Incorrect
AUC ROC distinguishes the classes over all thresholds; it does not hold recall at the required 90%.
CAUC PR, to focus the model on the less common class
Incorrect
AUC PR helps with the rare class across thresholds, but it does not optimize for the stated recall operating point.
DLog loss, to keep the predicted probabilities accurate
Incorrect
Log loss targets well-calibrated probabilities, not the precision at a given recall.
AutoML classification lets you change the default optimization objective. Precision at Recall (maximize-precision-at-recall) optimizes precision at a recall value you set, and Recall at Precision does the reverse. AUC ROC is the default for binary classification, AUC PR favors the less common class, and log loss keeps probabilities accurate.
A BigQuery ML logistic regression model predicts which customers will cancel. The retention team can call only about 2,000 customers a week, so it wants a customer marked positive only when the predicted probability is at least 0.8. The model itself performs well and should not change. What should the analyst do in the weekly scoring query?
ARetrain the model with AUTO_CLASS_WEIGHTS set to TRUE
BPass STRUCT(0.8 AS threshold) as the last argument of ML.PREDICT
CRun ML.EVALUATE with a threshold of 0.8 before each scoring run
DKeep the rows whose predicted label is 1 in the default ML.PREDICT output
Show the answer and why
ARetrain the model with AUTO_CLASS_WEIGHTS set to TRUE
Incorrect
Class weights change how the model is trained, and the team wants the model left as it is.
BPass STRUCT(0.8 AS threshold) as the last argument of ML.PREDICT
Correct
ML.PREDICT accepts a custom threshold for binary classification; scores above it become positive predictions.
CRun ML.EVALUATE with a threshold of 0.8 before each scoring run
Incorrect
ML.EVALUATE reports metrics at a threshold; it does not change the labels that ML.PREDICT returns.
DKeep the rows whose predicted label is 1 in the default ML.PREDICT output
Incorrect
The default output uses a 0.5 cutoff, so it marks far more customers as positive than the team can call.
For binary classification models, ML.PREDICT takes an optional THRESHOLD argument (default 0.5) in a STRUCT, for example STRUCT(0.55 AS threshold). Predictions above the threshold are positive. This changes the operating point without retraining the model.
A support team has 40,000 past tickets in BigQuery, each with the customer's message and the category and reply an expert wrote. Prompting a Gemini model gives replies in the wrong style. The analytics team works only in SQL, wants the tuned model's replies generated in batch inside BigQuery, and wants to compare the tuned model against the base model before it is used. What should the ML engineer do?
ACreate a remote model over the base Gemini endpoint and add twenty example tickets to every prompt that the analysts send through AI.GENERATE_TEXT
BTune a remote Gemini model with CREATE MODEL AS SELECT on the ticket columns, check it with ML.EVALUATE, then use AI.GENERATE_TEXT
CExport the tickets to Cloud Storage as JSONL, start a supervised tuning job from an Agent Platform notebook and call the tuned model from Python
DTrain a BigQuery ML boosted tree model on the messages and use it to pick one of the existing replies
Show the answer and why
ACreate a remote model over the base Gemini endpoint and add twenty example tickets to every prompt that the analysts send through AI.GENERATE_TEXT
Incorrect
Few-shot prompting can help style, but it does not use the 40,000 examples and adds tokens to every request; it is not tuning.
BTune a remote Gemini model with CREATE MODEL AS SELECT on the ticket columns, check it with ML.EVALUATE, then use AI.GENERATE_TEXT
Correct
The CREATE MODEL statement for tuning runs supervised fine-tuning on the selected rows, and the tuned remote model is evaluated and used from SQL.
CExport the tickets to Cloud Storage as JSONL, start a supervised tuning job from an Agent Platform notebook and call the tuned model from Python
Incorrect
Tuning in Agent Platform works, but it moves the work out of SQL, which the analytics team ruled out.
DTrain a BigQuery ML boosted tree model on the messages and use it to pick one of the existing replies
Incorrect
A classifier can predict the category but cannot write new replies in the experts' style.
BigQuery ML can fine-tune a Gemini model: CREATE MODEL with REMOTE WITH CONNECTION, the ENDPOINT of a supported model and an AS SELECT of prompt and label columns runs supervised tuning. You then evaluate the tuned model with ML.EVALUATE and generate text with AI.GENERATE_TEXT or AI.GENERATE_TABLE, all in SQL.
An operations team keeps hourly sensor readings for 300 pumps in BigQuery and wants each reading flagged when it is unusual for that pump's own daily and weekly pattern. The team works in SQL and already has an ARIMA_PLUS model trained on the readings with one series per pump. Which function should it use?
AML.FORECAST on the model, comparing each reading with the forecast by hand
BML.DETECT_ANOMALIES on the ARIMA_PLUS model
CML.PREDICT on a k-means model trained on all pumps together
DML.EVALUATE on the ARIMA_PLUS model for each pump
Show the answer and why
AML.FORECAST on the model, comparing each reading with the forecast by hand
Incorrect
ML.FORECAST predicts future values; flagging past readings would need extra logic that ML.DETECT_ANOMALIES already provides.
BML.DETECT_ANOMALIES on the ARIMA_PLUS model
Correct
ML.DETECT_ANOMALIES supports ARIMA_PLUS models for time series data and returns an anomaly flag and probability for each point.
CML.PREDICT on a k-means model trained on all pumps together
Incorrect
K-means suits independent data points, not each pump's time pattern, and the team already has the time series model.
DML.EVALUATE on the ARIMA_PLUS model for each pump
Incorrect
ML.EVALUATE reports how well the model fits; it does not flag individual readings.
ML.DETECT_ANOMALIES performs anomaly detection in BigQuery ML. For time series data it works with ARIMA_PLUS time series models; for independent and identically distributed data it works with k-means, PCA and autoencoder models.
An analyst trains a BigQuery ML boosted tree classifier and wants BigQuery ML to search over the learning rate and maximum tree depth automatically instead of trying values by hand. What should the analyst add to the CREATE MODEL statement?
AA NUM_TRIALS option, with HPARAM_RANGE for the two settings
BA TRANSFORM clause that lists the two hyperparameters
CA DATA_SPLIT_METHOD of RANDOM, which reshuffles the rows on every training run
DA separate CREATE MODEL statement for every combination of values
Show the answer and why
AA NUM_TRIALS option, with HPARAM_RANGE for the two settings
Correct
Setting NUM_TRIALS turns on hyperparameter tuning, and the ranges or candidates define the search space for each hyperparameter.
BA TRANSFORM clause that lists the two hyperparameters
Incorrect
TRANSFORM defines feature preprocessing, not a search over model settings.
CA DATA_SPLIT_METHOD of RANDOM, which reshuffles the rows on every training run
Incorrect
The split method decides how rows are divided; it does not try other hyperparameter values.
DA separate CREATE MODEL statement for every combination of values
Incorrect
Separate models are the manual search the analyst wants to avoid.
BigQuery ML runs hyperparameter tuning when you specify NUM_TRIALS in CREATE MODEL. Search spaces are given with HPARAM_RANGE or HPARAM_CANDIDATES, and tuning automatically splits the input into training, evaluation and test sets.
A team trains an Agent Platform AutoML regression model on three years of daily store transactions to predict next month's sales. With the default random split, test results look far better than what the model achieves in production. Which data split should the ML engineer choose?
AA random split with a larger test fraction of the rows held out
BA stratified random split on the store column
CA chronological split on the transaction date column
DNo split, with every row used for training
Show the answer and why
AA random split with a larger test fraction of the rows held out
Incorrect
A bigger random test set still mixes future rows into training, so it overstates accuracy the same way.
BA stratified random split on the store column
Incorrect
Agent Platform does not perform stratified sampling, and any split of the rows by store still lets the model train on rows later than the ones it is tested on.
CA chronological split on the transaction date column
Correct
A chronological split puts the most recent data in the test set, which matches how the model is used on future data.
DNo split, with every row used for training
Incorrect
Without held-out data there is no honest measure of performance at all.
For tabular training, Agent Platform supports random, manual and chronological splits. When the data is time-sensitive, use a chronological split on the time column, or a manual split that puts the most recent data in the test set, so that evaluation reflects performance on future data.
Finance wants a hard cap on how much any single Agent Platform AutoML tabular training run can cost. Which training setting gives that cap?
AThe optimization objective of the model
BA weight column on the training data
CThe chronological data split
DThe training budget in node hours
Show the answer and why
AThe optimization objective of the model
Incorrect
The objective decides what the model optimizes, not how long it trains.
BA weight column on the training data
Incorrect
A weight column changes how much each row counts during training.
CThe chronological data split
Incorrect
The split decides which rows train and test the model; it does not cap the cost.
DThe training budget in node hours
Correct
The training budget sets the maximum time the model trains, in node hours, which caps the training cost.
When you train an AutoML tabular model, you set the maximum number of node hours it can train for (trainBudgetMilliNodeHours in the API), which caps the training cost. Early stopping can end training sooner.