Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Machine Learning Engineer practice bank has an additional 974 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
Your organization's fraud analytics team is building a binary classification model directly in BigQuery ML to detect fraudulent transactions (is_fraud) from an imbalanced table (analytics.transactions). You must satisfy the following engineering and evaluation requirements:
ML.QUANTILE_BUCKETIZE) to transaction_amount, compute a feature cross (ML.FEATURE_CROSS) between merchant_category and country_code, retain a custom split column (split_col) and the label (is_fraud), and drop unused columns such as customer_notes so callers do not need to supply them during inference.BOOSTED_TREE_CLASSIFIER) using Bayesian hyperparameter optimization via Vizier across 20 trials (4 in parallel), optimizing for ROC_AUC.Which SQL workflow correctly constructs, tunes, and evaluates this model in BigQuery ML?
AS SELECT query using ML.QUANTILE_BUCKETIZE(transaction_amount) OVER (PARTITION BY country_code) AS amount_bucket, ML.FEATURE_CROSS(STRUCT(merchant_category, country_code)) AS merchant_geo_cross, split_col AS data_split_col, and CAST(is_fraud AS INT64) AS label, without a TRANSFORM clause. Train a BOOSTED_TREE_CLASSIFIER with HPARAM_TUNING_ALGORITHM = 'GRID_SEARCH', NUM_TRIALS = 20, and HPARAM_TUNING_OBJECTIVES = ['ROC_AUC']. Evaluate the model exclusively with ML.ROC_CURVE and re-run ML.QUANTILE_BUCKETIZE inside downstream ML.PREDICT queries.Applying preprocessing functions directly inside the AS SELECT training query transforms data prior to ingestion without storing transformation metadata inside the BigQuery ML model artifact. GRID_SEARCH evaluates a fixed Cartesian grid of hyperparameter combinations rather than adaptively selecting promising configurations.
ML.QUANTILE_BUCKETIZE must always use an empty OVER () clause; specifying OVER (PARTITION BY country_code) causes a SQL syntax error.TRANSFORM clause means quantile bin boundaries are not saved with the model. Re-running ML.QUANTILE_BUCKETIZE inside ML.PREDICT computes completely different bucket edges from each inference batch, corrupting feature distributions.GRID_SEARCH exhaustively steps through a static grid instead of using Bayesian optimization (VIZIER_DEFAULT), wasting trial budget in high-dimensional hyperparameter spaces.ML.ROC_CURVE without ML.EVALUATE and ML.CONFUSION_MATRIX omits aggregate loss/log-loss metrics and exact true-positive/false-positive counts at the chosen production threshold.OVER (...) clauses are unsupported for BigQuery ML analytic preprocessing functions.TRANSFORM, unused columns must be explicitly filtered in every SELECT statement.GRID_SEARCH over a small discrete parameter space rather than Bayesian optimization.MODEL_TYPE = 'TRANSFORM_ONLY' model containing ML.QUANTILE_BUCKETIZE(transaction_amount) OVER () AS amount_bucket, ML.FEATURE_CROSS(STRUCT(merchant_category, country_code)) AS merchant_geo_cross, split_col AS custom_split, and is_fraud AS target_label. Train a BOOSTED_TREE_CLASSIFIER over ML.TRANSFORM(...) using HPARAM_TUNING_ALGORITHM = 'RANDOM_SEARCH', NUM_TRIALS = 20, L1_REG = 1.0, and EARLY_STOP = TRUE. Evaluate the model using ML.TRAINING_INFO and ML.EVALUATE at the default threshold, and pass customer_notes into ML.PREDICT to maintain schema compatibility.A TRANSFORM_ONLY model decouples feature preprocessing into a reusable standalone artifact that can be invoked via ML.TRANSFORM across multiple downstream training or batch inference pipelines. RANDOM_SEARCH samples hyperparameter combinations uniformly at random without learning from prior trial outcomes.
TRANSFORM clause, columns referenced as label or data_split_col must appear untransformed by their original column name without aliases. Aliasing split_col AS custom_split or is_fraud AS target_label violates BigQuery ML TRANSFORM rules.RANDOM_SEARCH without HPARAM_TUNING_OBJECTIVES = ['ROC_AUC'] fails to perform Bayesian Vizier optimization targeting ROC_AUC.ML.TRAINING_INFO only inspects iteration-level training and evaluation loss, and default ML.EVALUATE checks only the 0.5 cutoff without ML.ROC_CURVE or ML.CONFUSION_MATRIX.TRANSFORM (such as customer_notes) are dropped from the model signature and do not need to be supplied during ML.PREDICT.TRANSFORM_ONLY models add an extra artifact when transformations are not shared across multiple separate models.ML.TRAINING_INFO cannot replace ML.ROC_CURVE or ML.CONFUSION_MATRIX for threshold calibration.L1_REG with EARLY_STOP = TRUE can obscure regularization effects during manual tuning.ML.TRANSFORM without aliasing label or data_split_col, and random hyperparameter search met your optimization goals.CREATE OR REPLACE MODEL with MODEL_TYPE = 'AUTOML_CLASSIFIER' and a TRANSFORM clause containing ML.QUANTILE_BUCKETIZE(transaction_amount) OVER () AS amount_bucket, ML.FEATURE_CROSS(STRUCT(merchant_category, country_code)) AS merchant_geo_cross, split_col, and is_fraud. Configure NUM_TRIALS = 20, HPARAM_TUNING_ALGORITHM = 'VIZIER_DEFAULT', and HPARAM_TUNING_OBJECTIVES = ['ROC_AUC']. After training completes, evaluate the model using ML.EVALUATE to inspect roc_auc and default-threshold metrics, and run ML.GLOBAL_EXPLAIN to confirm the model meets production precision and recall targets.AUTOML_CLASSIFIER trains a managed tabular classification model using automated neural architecture search, automated feature engineering, and automated hyperparameter optimization. ML.GLOBAL_EXPLAIN computes global feature attributions to explain which input columns most strongly influence model predictions overall.
BOOSTED_TREE_CLASSIFIER with explicit Vizier tuning options (NUM_TRIALS, HPARAM_TUNING_ALGORITHM, HPARAM_TUNING_OBJECTIVES). AUTOML_CLASSIFIER manages feature engineering and hyperparameter search internally and does not support manual hyperparameter tuning trial configurations.ML.EVALUATE without specifying a custom threshold evaluates precision and recall only at the default 0.5 probability cutoff, which is typically suboptimal for highly imbalanced fraud datasets.ML.GLOBAL_EXPLAIN outputs feature importance scores rather than confusion matrix counts or ROC curve trade-offs, so it cannot verify precision and recall targets.AUTOML_CLASSIFIER relies on a BUDGET_HOURS option rather than NUM_TRIALS and VIZIER_DEFAULT.TRANSFORM preprocessing pipelines.BUDGET_HOURS and OPTIMIZATION_OBJECTIVE, without manual TRANSFORM feature engineering or custom Vizier hyperparameter trials, and needed global feature attributions rather than threshold calibration.CREATE OR REPLACE MODEL with MODEL_TYPE = 'BOOSTED_TREE_CLASSIFIER' and a TRANSFORM clause containing ML.QUANTILE_BUCKETIZE(transaction_amount) OVER () AS amount_bucket, ML.FEATURE_CROSS(STRUCT(merchant_category, country_code)) AS merchant_geo_cross, split_col, and is_fraud (untransformed without aliases), while omitting customer_notes. Set INPUT_LABEL_COLS = ['is_fraud'], DATA_SPLIT_METHOD = 'CUSTOM', DATA_SPLIT_COL = 'split_col', NUM_TRIALS = 20, MAX_PARALLEL_TRIALS = 4, HPARAM_TUNING_ALGORITHM = 'VIZIER_DEFAULT', and HPARAM_TUNING_OBJECTIVES = ['ROC_AUC']. Inspect trials with ML.TRIAL_INFO, review aggregate metrics with ML.EVALUATE, and run ML.ROC_CURVE and ML.CONFUSION_MATRIX with a specified threshold to verify production precision and recall targets.This workflow combines inline feature engineering via the TRANSFORM clause, Bayesian hyperparameter tuning via Vizier (VIZIER_DEFAULT), and threshold-aware diagnostic evaluation directly inside BigQuery using standard SQL.
TRANSFORM preprocessing: Analytic preprocessing functions such as ML.QUANTILE_BUCKETIZE require an empty OVER () window specification so BigQuery ML computes global training quantile boundaries and automatically reapplies those exact boundaries during ML.EVALUATE and ML.PREDICT. Passing split_col and is_fraud directly without expressions or aliases satisfies BigQuery ML's strict requirement for data_split_col and label columns. Omitting customer_notes excludes it from training and removes any requirement to provide it at inference time.HPARAM_TUNING_ALGORITHM = 'VIZIER_DEFAULT' with NUM_TRIALS = 20, MAX_PARALLEL_TRIALS = 4, and HPARAM_TUNING_OBJECTIVES = ['ROC_AUC'] instructs BigQuery ML to iteratively explore hyperparameter configurations for BOOSTED_TREE_CLASSIFIER using Gaussian-process Bayesian optimization rather than brute-force search.ML.TRIAL_INFO, ML.ROC_CURVE evaluates true-positive and false-positive trade-offs across classification cutoffs, while ML.CONFUSION_MATRIX (configured with a custom THRESHOLD) confirms exact precision and recall counts for the imbalanced fraud dataset.ML.PREDICT input schema.Unlike query-level preprocessing or AutoML models that disallow explicit hyperparameter tuning configurations, this SQL design adheres to every BigQuery ML syntactic constraint while providing full control over imbalanced classification threshold selection.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated