← All Google Cloud AI guidesSection 1 · 1.1, 1.2

Low-code AI: BigQuery ML, AutoML and prebuilt AI APIs

Section 1 of the exam: building models with SQL in BigQuery ML (model types, TRANSFORM, evaluation, forecasting, explanations, remote Gemini models and tuning), AutoML on Agent Platform, and the prebuilt Vision, Document AI, Translation and Speech APIs. Includes a hands-on BigQuery ML lab.

1. The low-code ladder

Exam section 1 (about 13%) rewards picking the least effort that meets the requirement. Climb only when the rung below can't do the job.

RungYou provideYou getChoose when
1. Prebuilt API (Vision, Document AI, Translation, Speech, Natural Language)Nothing but the inputGoogle's model, no trainingThe task is generic: OCR, common labels, translation, transcription
2. Gemini prompting (optionally from BigQuery)A prompt and maybe examplesFlexible extraction, classification, summarizationUnstructured text or images with your own categories, few or no labels
3. BigQuery MLSQL over labelled tablesA model trained and scored in the warehouseTabular data already in BigQuery, SQL team, batch scoring
4. AutoMLLabelled dataA searched architecture and an endpoint-ready modelYour own labels (especially images), best accuracy with no model code
5. Custom trainingCode, containers, tuningFull controlCustom architecture or loss, huge data, distributed training
Cue words: "minimal effort", "no ML expertise", "analysts know SQL", "quickly" all point down the ladder. "Custom loss", "specific architecture", "full control" point up.

2. BigQuery ML: models in SQL

BigQuery ML (BQML) trains and runs models with SQL, inside BigQuery. The data never leaves the warehouse, analysts don't need Python, and prediction runs over whole tables. It's the default answer when "the data is in BigQuery" and "the team knows SQL".

Business problemmodel_typeNotes
Predict a number (revenue, duration)LINEAR_REG, BOOSTED_TREE_REGRESSOR, RANDOM_FOREST_REGRESSOR, DNN_REGRESSORStart linear for interpretability, boosted trees for accuracy on tabular data
Predict a class (churn, fraud)LOGISTIC_REG, BOOSTED_TREE_CLASSIFIER, DNN_CLASSIFIER, AUTOML_CLASSIFIERauto_class_weights=TRUE for imbalanced labels
Forecast a time seriesARIMA_PLUS, ARIMA_PLUS_XREG (extra regressors), TIMESFM via AI.FORECASTHandles seasonality, holidays and many series at once with time_series_id_col
Group customers with no labelsKMEANSUnsupervised; also used for anomaly detection by distance to centroid
Recommend productsMATRIX_FACTORIZATIONExplicit (ratings) or implicit (clicks) feedback
Reduce dimensions / detect anomaliesPCA, AUTOENCODERPair with ML.DETECT_ANOMALIES
Use a Gemini or other hosted model from SQLRemote model (REMOTE WITH CONNECTION)Generate text, embeddings, classify or extract with ML.GENERATE_TEXT / AI.GENERATE, ML.GENERATE_EMBEDDING
Bring an existing modelImported TensorFlow, ONNX, XGBoostRun batch prediction in SQL on a model trained elsewhere
-- Train: the TRANSFORM clause stores preprocessing with the model,
-- so ML.PREDICT applies exactly the same steps at prediction time.
CREATE OR REPLACE MODEL `shop.churn_model`
TRANSFORM(
  ML.STANDARD_SCALER(tenure_days) OVER () AS tenure_scaled,
  ML.QUANTILE_BUCKETIZE(monthly_spend, 10) OVER () AS spend_bucket,
  plan_type,
  churned
)
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'            -- also register it in Model Registry
) AS
SELECT tenure_days, monthly_spend, plan_type, churned
FROM `shop.customers`
WHERE signup_date < '2026-01-01';

SELECT * FROM ML.EVALUATE(MODEL `shop.churn_model`);          -- precision, recall, roc_auc, log_loss...
SELECT * FROM ML.GLOBAL_EXPLAIN(MODEL `shop.churn_model`);    -- which features matter overall
SELECT * FROM ML.PREDICT(MODEL `shop.churn_model`,
                         (SELECT * FROM `shop.customers_today`));
SELECT * FROM ML.EXPLAIN_PREDICT(MODEL `shop.churn_model`,    -- per-row attributions
                         (SELECT * FROM `shop.customers_today`), STRUCT(3 AS top_k_features));
FunctionUse
ML.EVALUATEMetrics on the held-out split (or a table you pass)
ML.PREDICTBatch prediction over a query
ML.FORECAST, ML.EXPLAIN_FORECASTFuture values with prediction intervals; trend/seasonality decomposition
ML.EXPLAIN_PREDICT, ML.GLOBAL_EXPLAIN, ML.FEATURE_IMPORTANCELocal and global explanations (feature importance for tree models)
ML.CONFUSION_MATRIX, ML.ROC_CURVEChoose a classification threshold
ML.DETECT_ANOMALIESAnomalies from ARIMA_PLUS, k-means, PCA or autoencoder models
ML.FEATURE_CROSS, ML.BUCKETIZE, ML.ONE_HOT_ENCODER, ML.IMPUTERFeature engineering, ideally inside TRANSFORM
CREATE MODEL ... OPTIONS(model_type='PCA') or feature importanceFeature selection and dimensionality reduction

Splits, tuning and export

OptionValues and meaning
data_split_methodAUTO_SPLIT (default, random by size), RANDOM, CUSTOM (a boolean column you provide), SEQ (by an ordering column: use for time), NO_SPLIT
data_split_col, data_split_eval_fractionWhich column and how much goes to evaluation
num_trials, max_parallel_trials, hparam_tuning_objectivesBuilt-in hyperparameter tuning; ranges with HPARAM_RANGE / HPARAM_CANDIDATES; inspect with ML.TRIAL_INFO
l1_reg, l2_reg, early_stop, max_tree_depth, subsampleRegularization and capacity controls
class_weights / auto_class_weightsImbalanced labels
EXPORT MODEL ... OPTIONS(URI='gs://BUCKET/...')Export to Cloud Storage (TensorFlow SavedModel or XGBoost booster) to serve elsewhere
model_registry='VERTEX_AI'Register in Model Registry; deploy to an endpoint for online predictions
-- Built-in tuning: 20 trials, 4 at a time, optimizing ROC AUC
CREATE OR REPLACE MODEL `shop.churn_tuned`
OPTIONS(
  model_type = 'BOOSTED_TREE_CLASSIFIER',
  input_label_cols = ['churned'],
  num_trials = 20, max_parallel_trials = 4,
  hparam_tuning_objectives = ['roc_auc'],
  max_tree_depth = HPARAM_RANGE(3, 10),
  learn_rate = HPARAM_RANGE(0.01, 0.3)
) AS SELECT * FROM `shop.training_view`;

SELECT * FROM ML.TRIAL_INFO(MODEL `shop.churn_tuned`);
For time-ordered data, set data_split_method='SEQ' (or a custom split column). The default random split leaks the future into training.

When BigQuery ML is the wrong tool

3. Gemini and remote models from BigQuery

A remote model points BigQuery at a hosted model (Gemini, an embedding model, or your own endpoint) through a connection whose service account has Agent Platform access. Generation and embedding then run as SQL over tables.

FunctionUse
ML.GENERATE_TEXT / AI.GENERATE, AI.GENERATE_TABLESummarize, classify, extract fields (structured output into columns)
ML.GENERATE_EMBEDDINGEmbeddings for text (and images via object tables)
VECTOR_SEARCH, CREATE VECTOR INDEXSimilarity search in BigQuery: simple RAG or semantic dedup without another database
Object tablesQuery unstructured files in Cloud Storage (images, PDFs) as rows
ML.UNDERSTAND_TEXT, ML.TRANSLATE, ML.PROCESS_DOCUMENT, ML.TRANSCRIBEPrebuilt Cloud AI APIs called from SQL

BQML can supervised-tune a Gemini model on prompt/response pairs stored in a table, then serve it as a remote model, all from SQL:

CREATE OR REPLACE MODEL `support.ticket_tagger`
  REMOTE WITH CONNECTION `us.vertex_conn`
  OPTIONS (
    endpoint = 'gemini-2.5-flash',          -- base model to tune
    max_iterations = 300,
    prompt_col = 'prompt',
    input_label_cols = ['label']
  ) AS
SELECT prompt, label FROM `support.labelled_examples`;

SELECT * FROM ML.GENERATE_TEXT(MODEL `support.ticket_tagger`,
  (SELECT ticket_text AS prompt FROM `support.new_tickets`),
  STRUCT(0.0 AS temperature, TRUE AS flatten_json_output));
Supported base models, option names and the newer AI.GENERATE* functions change often. Check the BigQuery ML documentation for your release. The pattern to remember: a connection (a BigQuery connection resource whose service account has Agent Platform access), a remote model, and generation functions run over tables.

4. AutoML

AutoML trains a high-quality model from labelled data with no model code: it searches architectures and hyperparameters for you. You pay in node hours and give up control of the architecture and loss.

Data typeTasksNotes
TabularClassification, regression, forecastingFrom BigQuery or CSV in Cloud Storage. Set a training budget; enable early stopping. Tabular Workflows give a pipeline-based, more configurable version (End-to-End AutoML, TabNet, Wide & Deep, forecasting).
ImageClassification (single/multi-label), object detectionCan export Edge-optimized models (TF Lite, Core ML, container) for on-device use
VideoClassification, object tracking, action recognitionBeing replaced by Gemini prompting for many uses
TextClassification, entity extraction, sentimentGoogle now steers text tasks to Gemini prompting or tuning; legacy AutoML text is retired. Expect "use Gemini" as the modern answer
ChooseWhen
BigQuery MLData in BigQuery, SQL skills, batch scoring in the warehouse, quick baselines, forecasting many series
AutoMLBest accuracy without ML expertise, images or video, or tabular data where you want an online endpoint quickly
Custom trainingCustom architecture, loss or framework, very large data, distributed training, full control
Exporting BigQuery data to CSV to train elsewhere is almost never the answer when BQML or a BigQuery-sourced AutoML dataset meets the requirements. And AutoML isn't free of cost: it's often more expensive than a simple BQML model; the trade is accuracy and zero model code.

AutoML practicalities

TopicWhat to know
Data volumeImage classification works from roughly hundreds of images per label; more is better; balance the labels
BudgetTraining budget in node hours; early stopping ends sooner when quality plateaus
Optimization objective (tabular)Choose to match the business: maximize AU-PRC for rare positives, minimize log loss for probabilities, RMSE/MAE for regression
Data splitRandom, manual (a column), or chronological (a time column) for forecasting and time-dependent data
ExplainabilityFeature attributions for tabular models; evaluation shows confusion matrix and per-label metrics
DeploymentModel Registry → endpoint (online) or batch inference; edge export for image models
AutoML tabular objective: rare positives → AU-PRC; probabilities matter → log loss; balanced and ranking → AU-ROC.

5. Prebuilt AI APIs

APIDoesExam cue
Cloud Vision APILabels, OCR (text detection, document text detection), faces, landmarks, logos, SafeSearch, objects"Detect common objects or read text in photos" with no custom labels
Document AIProcessors for invoices, receipts, IDs, forms, layout; custom extractors trained from a few documents"Extract fields from invoices or forms into structured data"
Cloud Translation APIBasic and Advanced (glossaries, batch document translation, adaptive translation, custom models)"Keep product names untranslated" → a glossary
Speech-to-Text / Text-to-SpeechTranscription with model adaptation (phrase hints), diarization; natural voices"Recognize domain terms in calls" → speech adaptation
Natural Language APISentiment, entities, syntax, content classificationQuick sentiment with no training
Video Intelligence APIShot changes, labels, explicit content, text in videoCatalogue video archives
Industry solutionsHealthcare Natural Language, Contact Center AI, Recommendations AIDomain-specific managed products
If a prebuilt API covers the task with acceptable accuracy, it wins: no data labelling, no training, no serving to manage. Move to AutoML, a custom Document AI extractor, or Gemini only when you need your labels or classes.

Customizing without training a model

NeedFeature
Keep brand and product names consistent in translationTranslation Advanced glossary
Recognize jargon, product names, alphanumeric codes in speechSpeech-to-Text model adaptation (phrase sets, boosts)
Who spoke whenSpeaker diarization
Fields from a document type no prebuilt processor coversDocument AI Custom Extractor (generative, from a few labelled documents)
Layout-aware chunks for RAG from PDFsDocument AI layout parser
Your own image categoriesAutoML image or Gemini with examples (Vision API labels are fixed)

6. Lab: churn model end to end in BigQuery ML

Use a sandbox project with billing alerts. Placeholders: PROJECT_ID, dataset shop, region us-central1.

  1. Load a public e-commerce or telco churn table into your dataset, or create shop.customers with a label column.
  2. Train a LOGISTIC_REG baseline, then a BOOSTED_TREE_CLASSIFIER with a TRANSFORM clause and auto_class_weights=TRUE.
  3. Compare with ML.EVALUATE. Run ML.CONFUSION_MATRIX at thresholds 0.3, 0.5 and 0.7 and pick one with the confusion-matrix calculator.
  4. Run ML.EXPLAIN_PREDICT on five rows and ML.GLOBAL_EXPLAIN. Is any feature suspiciously dominant (possible leakage)?
  5. Retrain with num_trials=10 and read ML.TRIAL_INFO.
  6. Retrain with model_registry='VERTEX_AI' and find the model in Model Registry.
  7. Create a remote Gemini model through a connection and use ML.GENERATE_TEXT to summarize the 20 most recent support tickets per churner.

You should be able to say: why TRANSFORM prevents training-serving skew, why PR AUC beats accuracy here, and how batch scoring in SQL avoids running an endpoint. Clean up: DROP MODEL for each model; delete the dataset and the connection.

7. "Which low-code option?" chooser

Pick an item to see what it means, why, and the tempting wrong choice.

Pick one above.

8. Sample outputs

What the tools return. Expand an item to see a typical result and what to read in it.

Illustrative output, not captured from a real project. IDs, numbers and some field names are invented or simplified, and formats change between releases. Learn the shape and the fields called out under each one.
SELECT * FROM ML.EVALUATE(MODEL `shop.churn_model`)Classification metrics from BigQuery ML
precision  recall  accuracy  f1_score  log_loss  roc_auc
0.412      0.783   0.951     0.540     0.142     0.931

What to look at: Accuracy 0.95 looks great but churners are rare, so it means little. Recall 0.78 with precision 0.41 says the model finds most churners at the cost of many false alarms, at the default 0.5 threshold. For a retention campaign where a false alarm costs a discount, check ML.ROC_CURVE or ML.CONFUSION_MATRIX and move the threshold. ROC AUC 0.93 overstates quality on imbalanced data; compare PR AUC.

SELECT * FROM ML.GLOBAL_EXPLAIN(MODEL `shop.churn_model`)Global feature attributions
feature          attribution
tenure_scaled    0.318
support_tickets  0.244
spend_bucket     0.131
plan_type        0.087
last_refund_flag 0.512

What to look at: last_refund_flag dominates. If refunds are often issued as part of cancelling, the feature leaks the label: it's known only after churn. Suspiciously strong features in attributions are the classic sign of leakage; remove it and retrain.

SELECT * FROM ML.FORECAST(MODEL `retail.sales_arima`, STRUCT(14 AS horizon, 0.9 AS confidence_level))ARIMA_PLUS forecast with intervals
store_id  forecast_timestamp       forecast_value  prediction_interval_lower_bound  prediction_interval_upper_bound
s-014     2026-11-15 00:00:00 UTC  1843.2          1611.7                           2074.7
s-014     2026-11-16 00:00:00 UTC  2210.9          1958.0                           2463.8
s-022     2026-11-15 00:00:00 UTC   932.4           801.3                           1063.5

What to look at: One model forecasts every store because time_series_id_col was set. The 90% interval is what inventory planning should use for safety stock, not just the point forecast.

9. Scenarios

Exam-style situations: how to diagnose each one, the likely cause and the fix.

10. Searchable reference

ItemMeaning

11. Flashcards (click to flip)

12. Common gotchas in one list

  1. Data in BigQuery and a SQL team means BigQuery ML, not exporting CSVs to a custom job.
  2. Use TRANSFORM so preprocessing travels with the model and serving can't drift from training.
  3. Random splits on time data leak the future; use SEQ or a custom time column.
  4. Prebuilt APIs win when classes are generic; custom labels need AutoML, Gemini or custom training.
  5. AutoML text is retired; text classification and extraction now point to Gemini.
  6. Remote models need a connection, and the connection's service account needs Agent Platform access.
  7. Batch scoring in SQL avoids endpoint costs; deploy only when you need online latency.
  8. Glossary for terminology, speech adaptation for jargon: customization without training.
  9. AutoML isn't automatically cheaper: node hours add up; set budgets and early stopping.
  10. Match the AutoML objective to the business: AU-PRC for rare positives.

13. Practice quiz (22 questions)

Score: 0 / 0
← ML fundamentals 2: bias-variance and metricsNext: Gemini, Model Garden and Agent Platform →