Study guide
1.3 Generating Predictions with BigQuery ML
Google Cloud Professional Machine Learning Engineer Exam
Track your progress as you read
Finished sections get a check mark.
1 Introduction & Exam Overview
0.1 Exam Overview, Blueprint & Certification Logistics 0.2 Study Strategy, Scenario Mechanics & 8-Week Roadmap
2 Section 1: Architecting Low-Code AI Solutions (~13%)
1.1 BigQuery ML: Model Types, SQL Syntax and In-Database Evaluation 1.2 Feature Engineering and Feature Selection in BigQuery ML 1.3 Generating Predictions with BigQuery ML 1.4 AutoML on Agent Platform: Tabular, Image, Text and Video Training 1.5 Fine-Tuning Gemini Models from BigQuery 1.6 Model Garden: Evaluating and Selecting the Right Model 1.7 Industry-Specific AI APIs: Document AI, Vision, Translate and Speech 1.8 Generative Media and Models as a Service: Gemini, Imagen and Veo 1.9 Optimizing Gemini Applications for Cost, Latency and Availability
3 Section 2: Collaborating Within and Across Teams to Manage Data and Models (~16%)
2.1 Organizing and Exploring Tabular, Text, Image and Video Data 2.2 Choosing the Preprocessing Tool: BigQuery, Dataflow, Spark and In-Memory Python 2.3 Creating and Consolidating Features in Agent Platform Feature Store 2.4 Data Privacy, PII Handling and Sensitive Information 2.5 Notebook Environments: Collaboration and Security Best Practices 2.6 Prototyping in Workbench and Colab Enterprise with PyTorch, scikit-learn and JAX 2.7 Prototyping with Model Garden Foundational and Open Models in Notebooks 2.8 Choosing the Development and Experimentation Environment 2.9 Evaluating Generative Solutions: LLM-as-a-Judge and RAG Evaluation 2.10 Experiment Tracking, Artifact Lineage and Model Registry Governance
4 Section 3: Scaling Prototypes into ML Models (~21%)
3.1 Choosing the Model Type: ARIMA, DNN, LLM and Classical Baselines 3.2 Choosing the Product: AutoML, BigQuery ML, Custom Training and Pipelines 3.3 Choosing the Deployment Strategy at Design Time 3.4 Modeling Techniques for Interpretability Requirements 3.5 Organizing Training Data on Cloud Storage and BigQuery 3.6 Ingesting Structured and Unstructured Data into Training Pipelines 3.7 Training SDKs and Services: Custom Training, Kubeflow on GKE, AutoML and Tabular Workflows 3.8 Troubleshooting ML Model Training Failures 3.9 Hyperparameter Tuning, Bayesian Optimization and Vizier 3.10 Model Evaluation Metrics, Transfer Learning and Fine-Tuning 3.11 Evaluating Compute and Accelerator Options: CPU, GPU and TPU 3.12 Distributed Training Strategies, Hardware Acceleration and Performance Optimization
5 Section 4: Serving and Scaling Models (~20%)
4.1 Batch and Online Inference: Agent Platform, Model Garden, Cloud Run and GKE 4.2 Rollout Strategies: Canary, Traffic Splitting, Shadow and Blue-Green 4.3 Tuning Models for Production: Vector Search and Model Compression 4.4 Deploying Models to Public and Private Endpoints 4.5 Choosing Serving Hardware: CPU, GPU, TPU and Edge 4.6 Scaling the Serving Backend for Throughput
6 Section 5: Automating and Orchestrating ML Pipelines (~18%)
5.1 Validating Data and Models Inside Pipelines 5.2 Agent Platform Pipelines: Kubeflow Pipelines (KFP) and TFX Architecture 5.3 Reusable Pipeline Components, Artifacts and ML Metadata Lineage 5.4 Ray on Agent Platform for Distributed Python Workloads 5.5 MLOps CI/CD Automation, Retraining Triggers and Skew Prevention
7 Section 6: Monitoring AI Solutions (~13%)
6.1 Securing AI Systems: Exfiltration, Malicious Prompting and Model Armor 6.2 Responsible AI, Explainable AI, Fairness Metrics and Model Governance 6.3 Model Monitoring: Feature Skew and Drift Detection 6.4 Operational Troubleshooting, Performance Profiling and Cost Optimization 6.5 Monitoring, Testing and Evaluating Generative AI in Production
1.3 Generating Predictions with BigQuery ML
Key Takeaways Explain This Topic AI
ML.PREDICT is the general inference function; forecasting models use ML.FORECAST, matrix factorization uses ML.RECOMMEND, and clustering models use ML.PREDICT for assignment or ML.DETECT_ANOMALIES for outliers.
BigQuery ML inference is inherently batch and serverless — it has no endpoint, no autoscaling, and no single-digit-millisecond path, so real-time serving requires exporting the model or registering it with Agent Platform.
ML.EXPLAIN_PREDICT returns per-row feature attributions alongside each prediction, and top_k_features controls how many contributors are returned.
EXPORT MODEL writes a TensorFlow SavedModel or XGBoost Booster to Cloud Storage, which can then be deployed to an Agent Platform Inference endpoint for online serving.
A remote model registered against an Agent Platform endpoint lets ML.PREDICT call a model trained outside BigQuery, keeping the SQL interface while the model lives elsewhere.
Last updated: September 2026
- 1.3 Generating Predictions with BigQuery ML
- Blueprint reference: Section 1.1, "Generating predictions using BigQuery ML."
Training a model in SQL is the easy half. The exam concentrates on the consequences of BigQuery ML's serving model, because that is where architectural decisions actually get made: BigQuery ML inference is serverless, analytical, and batch-shaped . There is no endpoint to deploy, no minimum replica count, and no path to a 20 ms p99. Every scenario that mentions real-time inference is testing whether you know to leave BigQuery for the serving step.
The Inference Function Family
Function Applies to Returns
ML.PREDICT Regression, classification, clustering, imported models predicted_<label> plus, for classifiers, a predicted_<label>_probs array
- ML.FORECAST ARIMA_PLUS , ARIMA_PLUS_XREG Forecast values with prediction intervals and confidence levels
- ML.RECOMMEND MATRIX_FACTORIZATION Ranked item recommendations per user
ML.DETECT_ANOMALIES KMEANS , ARIMA_PLUS , AUTOENCODER , PCA Boolean is_anomaly plus a distance or reconstruction score
- ML.EXPLAIN_PREDICT Supervised models Predictions plus per-row feature attributions
- ML.GENERATE_EMBEDDING Embedding and remote embedding models Dense vector representations
- AI.GENERATE , AI.GENERATE_TABLE Remote Gemini models Generated text or a typed table
The single most common exam slip is reaching for ML.PREDICT on a time-series model. ARIMA_PLUS models forecast forward from the training horizon; they do not score arbitrary input rows, so ML.FORECAST with a horizon and confidence_level is the only correct call. SELECT * FROM ML.FORECAST(
- MODEL `analytics.daily_demand`,
- STRUCT(30 AS horizon, 0.95 AS confidence_level)
- );
- Classification Output Shape
A binary classifier does not return only a class. It returns the predicted label plus an array of (label, prob) structs, which you must unnest to threshold on probability rather than accepting the default 0.5 cut. SELECT
- customer_id,
- predicted_churned,
- (SELECT prob FROM UNNEST(predicted_churned_probs)
- WHERE label = TRUE) AS churn_probability
- FROM ML.PREDICT(MODEL `analytics.churn_model`,
- TABLE `analytics.active_customers`)
- WHERE (SELECT prob FROM UNNEST(predicted_churned_probs)
- WHERE label = TRUE) > 0.72;
This matters commercially. If a retention offer costs money, the operating threshold is a business decision, not a modelling default. ML.ROC_CURVE gives you the true-positive and false-positive rates at each threshold so you can pick the point that maximizes expected value.
Per-Row Explanations
ML.EXPLAIN_PREDICT returns each prediction with the feature attributions that produced it, ordered by absolute contribution. top_k_features bounds the output width. SELECT * FROM ML.EXPLAIN_PREDICT(
- MODEL `analytics.credit_model`,
- TABLE `analytics.applications`,
- STRUCT(5 AS top_k_features)
- );
For linear models the attributions are exact coefficient contributions. For tree and DNN models BigQuery ML uses Shapley values , computed by sampling. ML.GLOBAL_EXPLAIN aggregates the same machinery across the whole training set to answer "which features matter overall," and requires enable_global_explain = TRUE at CREATE MODEL time — a flag you cannot retrofit without retraining.
The adverse-action notice requirement in lending is the canonical scenario: regulators require a per-applicant reason, which is a row-level explanation, so ML.EXPLAIN_PREDICT is correct and ML.GLOBAL_EXPLAIN is not.
When Predictions Must Leave BigQuery
BigQuery ML query latency is measured in seconds. Three patterns move a BigQuery-trained model to a low-latency surface.
1. EXPORT MODEL to Cloud Storage. Linear, logistic, DNN, Wide-and-Deep, k-means, autoencoder, and AutoML Tables models export as a TensorFlow SavedModel . Boosted tree and random forest models export as an XGBoost Booster file. The exported artifact can be uploaded to the Model Registry and deployed to an Agent Platform Inference endpoint, or run in any container that speaks TensorFlow Serving. EXPORT MODEL `analytics.churn_model`
OPTIONS (URI = 'gs://my-models/churn/v3');
2. Register a remote model. The inverse direction: create a BigQuery model object that points at an already-deployed Agent Platform endpoint through a BigQuery connection. Analysts keep writing ML.PREDICT while inference executes on the endpoint, which means one model version serves both the warehouse and the application.
3. Scheduled batch materialization. For recommendations, propensity scores, and lead ranking, real-time inference is often unnecessary. A scheduled query writes scores to a serving table, and the application reads that table — or an exported copy in Bigtable or Firestore — with millisecond latency. This is the most cost-effective answer whenever the scenario tolerates hours-old scores.
Cost and Performance Notes
ML.PREDICT is billed as a normal BigQuery query on the bytes scanned. Predicting on SELECT * over a wide table is expensive; select only the model's input columns.
Partition and cluster the input table on the columns used in the WHERE clause; inference over a partition-pruned scan can be an order of magnitude cheaper.
Batch inference over very large tables benefits from writing results to a destination table rather than streaming them to the client.
ML.PREDICT on an imported TensorFlow model runs the model inside BigQuery slots and has model size limits, so very large deep models belong on an endpoint rather than imported.
Exam Traps
Real-time serving from BigQuery ML. If the scenario says "under 100 ms" or "per user request," the answer involves exporting or registering with Agent Platform Inference, not a scheduled query.
ML.PREDICT on ARIMA_PLUS . Use ML.FORECAST .
Assuming ML.GLOBAL_EXPLAIN works retroactively. It requires the flag at creation time.
Forgetting the probability array. predicted_<label> already applied a 0.5 threshold; business thresholds require unnesting the probabilities.