Study guide

2.1 Choosing, Training & Predicting with BigQuery ML Models

Google Cloud Professional Machine Learning Engineer PMLE

Track your progress as you read

Finished sections get a check mark.

1 Chapter 1: Exam Overview & the Agent Platform Map

1.1 PMLE Exam Facts, Policies & the June 2026 Blueprint 1.2 From Vertex AI to Gemini Enterprise Agent Platform: The Product Name Map

2 Chapter 2: Low-Code ML with BigQuery ML

2.1 Choosing, Training & Predicting with BigQuery ML Models 2.2 Feature Engineering & Feature Selection in BigQuery ML 2.3 Fine-Tuning & Evaluating Gemini Models from BigQuery

3 Chapter 3: AutoML & Google Cloud AI APIs

3.1 Training Models with Agent Platform AutoML 3.2 Building with Document AI, Vision, Translation & Other AI APIs

4 Chapter 4: Foundation Models in Model Garden

4.1 Evaluating & Selecting Models in Model Garden 4.2 Building & Tuning Solutions with Gemini, Imagen, Veo & MaaS 4.3 Optimizing Gemini Applications for Cost, Latency & Availability

5 Chapter 5: Exploring, Preprocessing & Protecting Data

5.1 Organizing & Exploring Tabular, Text & Image Data 5.2 Choosing a Preprocessing Tool: BigQuery, Dataflow, Spark or Python 5.3 Creating & Consolidating Features in Agent Platform Feature Store 5.4 Protecting PII & Sensitive Data in ML Workflows

6 Chapter 6: Notebooks, Prototyping & Experiment Tracking

6.1 Workbench vs. Colab Enterprise: Secure, Collaborative Notebooks 6.2 Prototyping with PyTorch, scikit-learn, JAX & Model Garden in Notebooks 6.3 Experiment Environments, Tracking & Lineage with Experiments and ML Metadata

7 Chapter 7: Evaluating Predictive & Generative AI Solutions

7.1 Evaluation Metrics for Predictive Models 7.2 Evaluating Gen AI: Computation Metrics, Rubrics & LLM-as-a-Judge

8 Chapter 8: Choosing the Modeling Approach

8.1 Choosing the Model Type: ARIMA, Trees, DNNs & LLMs 8.2 Choosing the Product & Deployment Strategy 8.3 Modeling Techniques for Interpretability Requirements

9 Chapter 9: Training Data & Training SDKs

9.1 Organizing & Ingesting Training Data from Cloud Storage & BigQuery 9.2 Custom Training on Agent Platform: Containers, Jobs & Worker Pools 9.3 Kubeflow on GKE, AutoML & Tabular Workflows as Training Choices

10 Chapter 10: Troubleshooting, Hyperparameter Tuning & Fine-Tuning

10.1 Troubleshooting ML Training Failures 10.2 Hyperparameter Tuning on Agent Platform 10.3 Fine-Tuning Foundation Models & When to Tune

11 Chapter 11: Training Hardware & Distributed Training

11.1 Choosing CPUs, GPUs & TPUs for Training 11.2 Distributed Training: Data & Model Parallelism

12 Chapter 12: Deploying Models for Inference

12.1 Batch vs. Online Inference on Agent Platform 12.2 Serving Beyond Agent Platform Endpoints: Model Garden, Cloud Run & GKE 12.3 Prebuilt & Custom Serving Containers

13 Chapter 13: Model Versions, Rollouts & Inference Logic

13.1 Organizing & Versioning Models in Model Registry 13.2 Rollout Strategies: A/B Tests, Canaries & Traffic Splits 13.3 Inference Preprocessing & Postprocessing

14 Chapter 14: Scaling Online Serving

14.1 Serving Features Online with Feature Store 14.2 Public, Dedicated & Private Endpoints 14.3 Serving Hardware & Autoscaling for Throughput 14.4 Tuning Models for Production Training & Serving

15 Chapter 15: End-to-End ML Pipelines

15.1 Validating Data & Models in Pipelines 15.2 Agent Platform Pipelines with KFP: Components, Templates & Caching 15.3 Ensuring Consistent Preprocessing Between Training & Serving

16 Chapter 16: Orchestration with Managed Airflow & Ray

16.1 Orchestrating ML Workflows with Managed Service for Apache Airflow 16.2 Ray on Agent Platform for Distributed ML Workloads

17 Chapter 17: Automating Retraining & CI/CD/CT

17.1 Choosing a Retraining Policy 17.2 CI/CD/CT for ML with Cloud Build

18 Chapter 18: Securing AI Systems, Responsible AI & Explainability

18.1 Protecting AI Systems from Data & Model Exfiltration 18.2 Defending Gen AI Apps: Safety Filters, Model Armor & Regex Guardrails 18.3 Responsible AI: Detecting & Monitoring Bias 18.4 Model Explainability on Agent Platform

19 Chapter 19: Monitoring AI Solutions

19.1 Configuring Model Monitoring on Agent Platform 19.2 Training-Serving Skew, Data Drift, Concept Drift & Attribution Drift 19.3 Monitoring, Testing & Evaluating Gen AI Solutions in Production

2.1 Choosing, Training & Predicting with BigQuery ML Models

Key Takeaways Explain This Topic AI

BigQuery ML trains and runs models with SQL inside BigQuery, so data does not move to a separate training environment.

For forecasting, BigQuery ML offers ARIMA_PLUS for one variable, ARIMA_PLUS_XREG with covariates, and AI.FORECAST with the pre-trained TimesFM model.

ML.PREDICT uses a default binary classification threshold of 0.5, which you can change with the THRESHOLD argument.

ML.DETECT_ANOMALIES works with ARIMA_PLUS and ARIMA_PLUS_XREG for time series and with k-means, PCA, and autoencoder models for independent data.

Setting MODEL_REGISTRY = 'VERTEX_AI' registers a BigQuery ML model in Agent Platform Model Registry for deployment to an online endpoint without exporting it.

Last updated: September 2026

BigQuery ML (BQML) lets you create, evaluate, and use ML models with GoogleSQL. The data stays in BigQuery, SQL-skilled analysts can build models, and BigQuery's engine handles the scaling. On the exam, BQML is often the right low-code answer when the data is already in BigQuery and the team knows SQL better than Python.

Match the Business Problem to a Model Type

Business problem BQML MODEL_TYPE options Typical output function

Yes/no or category outcome (churn, fraud flag, product tier) LOGISTIC_REG , BOOSTED_TREE_CLASSIFIER , RANDOM_FOREST_CLASSIFIER , DNN_CLASSIFIER , DNN_LINEAR_COMBINED_CLASSIFIER , AUTOML_CLASSIFIER ML.PREDICT

Numeric value (spend, delivery time, price) LINEAR_REG , BOOSTED_TREE_REGRESSOR , RANDOM_FOREST_REGRESSOR , DNN_REGRESSOR , DNN_LINEAR_COMBINED_REGRESSOR , AUTOML_REGRESSOR ML.PREDICT

Future values of a time series ARIMA_PLUS , ARIMA_PLUS_XREG , or no model with AI.FORECAST (TimesFM) ML.FORECAST , AI.FORECAST

  • Customer or store segments without labels KMEANS ML.PREDICT (nearest centroid)
  • Product or content recommendations MATRIX_FACTORIZATION ( FEEDBACK_TYPE = EXPLICIT or IMPLICIT ) ML.RECOMMEND
  • Dimensionality reduction PCA , AUTOENCODER ML.PREDICT , ML.GENERATE_EMBEDDING

Unusual rows or time points ARIMA_PLUS / ARIMA_PLUS_XREG (time series); KMEANS , PCA , AUTOENCODER (independent rows) ML.DETECT_ANOMALIES

BQML can also import trained models ( TENSORFLOW , TENSORFLOW_LITE , ONNX , XGBOOST ) to score them in SQL. It can also create remote models over Gemini and other Agent Platform models for generative tasks (Section 2.3).

Choosing among the supervised options

Linear/logistic regression : fastest to train, easy to interpret through ML.WEIGHTS , and a good baseline.

Boosted trees and random forests (XGBoost-based): usually the strongest choice for tabular data with non-linear interactions. They handle categorical features through label encoding.

DNN and Wide & Deep : for large datasets with complex interactions. They are slower and harder to explain.

AutoML classifier/regressor : BQML sends training to Agent Platform AutoML, which handles feature engineering and tuning. You control the BUDGET_HOURS value (1.0-72.0, default 1.0) and an OPTIMIZATION_OBJECTIVE such as MAXIMIZE_AU_ROC .

  • Anatomy of CREATE MODEL CREATE OR REPLACE MODEL `retail.churn_bt`
  • OPTIONS (
  • model_type = 'BOOSTED_TREE_CLASSIFIER',
  • input_label_cols = ['churned'],
  • auto_class_weights = TRUE,
  • data_split_method = 'AUTO_SPLIT',
  • enable_global_explain = TRUE,
  • model_registry = 'VERTEX_AI'
  • ) AS
  • SELECT tenure_months, plan, monthly_spend, support_tickets, churned
  • FROM `retail.customer_features`;

input_label_cols names the label.

auto_class_weights = TRUE reweights classes by inverse frequency, which helps with imbalanced labels.

DATA_SPLIT_METHOD defaults to AUTO_SPLIT . Below 500 rows, all rows go to training. From 500 to 50,000 rows, 20% goes to evaluation. Above 50,000 rows, 10,000 rows are held out. With hyperparameter tuning, the split is 80/10/10 for training, evaluation, and test. RANDOM , CUSTOM (a BOOL column), SEQ (ordered column, for time-aware splits), and NO_SPLIT are also available.

Hyperparameter tuning uses NUM_TRIALS , HPARAM_RANGE / HPARAM_CANDIDATES , and HPARAM_TUNING_ALGORITHM ( VIZIER_DEFAULT , RANDOM_SEARCH , or GRID_SEARCH ). You can check trials with ML.TRIAL_INFO .

Forecasting Choices

Need Best BQML choice

Forecast one metric per series, explain trend, seasonality, and holiday effects ARIMA_PLUS with TIME_SERIES_TIMESTAMP_COL , TIME_SERIES_DATA_COL , optional TIME_SERIES_ID_COL , HORIZON , HOLIDAY_REGION

  • Forecast using covariates (price, promotions, weather) ARIMA_PLUS_XREG
  • Forecast immediately with no model to manage AI.FORECAST with the built-in TimesFM foundation model

ARIMA_PLUS trains one model per time series. Setting TIME_SERIES_ID_COL to a store or product ID fits thousands of series in a single statement. ML.EXPLAIN_FORECAST breaks forecasts into components, and ML.ARIMA_EVALUATE compares candidate models. TimesFM needs no training and offers little customization or explainability, so it fits quick baselines rather than cases that require explanations.

Evaluation and Prediction Functions

Function Purpose

ML.EVALUATE Metrics on held-out or supplied data (precision, recall, F1, log loss, ROC AUC for classifiers; MAE, MSE, R² for regressors)

ML.CONFUSION_MATRIX , ML.ROC_CURVE Threshold analysis for classifiers

ML.PREDICT Batch scoring. The THRESHOLD argument (default 0.5 ) sets the binary cutoff, and TRIAL_ID picks a tuning trial

  • ML.FORECAST / AI.FORECAST Future values with prediction intervals
  • ML.DETECT_ANOMALIES Flags anomalies with ANOMALY_PROB_THRESHOLD (time series) or contamination settings
  • ML.RECOMMEND Top items per user from matrix factorization

ML.EXPLAIN_PREDICT Predictions plus per-row feature attributions ( TOP_K_FEATURES defaults to 5) SELECT customer_id, predicted_churned, predicted_churned_probs

  • FROM ML.PREDICT(
  • MODEL `retail.churn_bt`,
  • (SELECT * FROM `retail.active_customers`),
  • STRUCT(0.35 AS threshold));

Lowering the threshold to 0.35 catches more likely churners (higher recall) and flags more false positives (lower precision). Choose it from ML.ROC_CURVE output and the cost of each error type.

Getting Predictions to Consumers

Batch in BigQuery: schedule ML.PREDICT as a scheduled query or pipeline step and write results to a table for dashboards or activation.

Online through Agent Platform: register the model ( MODEL_REGISTRY = 'VERTEX_AI' , optionally with VERTEX_AI_MODEL_ID and version aliases). Then deploy it from Model Registry to an endpoint. You don't need to export it or build a serving container.

Export: EXPORT MODEL writes to Cloud Storage. Most model types export as TensorFlow SavedModel, and boosted tree and random forest models export as an XGBoost Booster. Automatic preprocessing is saved with the model, so clients send raw features that match what ML.PREDICT expects.

Worked Scenario: Picking the Right Low-Code Path

A subscription company keeps 40 million customer-month rows in BigQuery. Marketing wants weekly churn scores for campaign targeting, and the analytics team writes SQL but not Python. Walk through the decision:

Problem type: a yes/no label (churned next month), so this is binary classification.

Where the data lives: BigQuery, which strongly favors BQML because nothing has to be exported.

Model choice: start with LOGISTIC_REG as a baseline, then train BOOSTED_TREE_CLASSIFIER and compare ML.EVALUATE results on the same holdout. If there's more time than feature-engineering skill, try AUTOML_CLASSIFIER with a budget of a few hours.

Consumption: weekly scores go into a table, so a scheduled ML.PREDICT query is enough. There's no need for an online endpoint.

Imbalance: churners are rare, so use AUTO_CLASS_WEIGHTS = TRUE and pick the threshold from ML.ROC_CURVE .

If the same company later needs a churn score during a live support chat, the need changes to online inference. Register the model in Model Registry and deploy it to an endpoint.

Exam Traps

Choosing Python custom training when the data is already in BigQuery and a standard classifier or forecast would do. BQML avoids moving data and adds almost no operational overhead.

Using LINEAR_REG for a yes/no label. Use a classifier.

Using a random split for time series. Use SEQ or a time-based CUSTOM split so future rows don't leak into training.

Expecting BQML to host a low-latency REST endpoint by itself. Register the model or export it for online serving.