Prepare and test your skills
Prepare and test your skills
Free sample question, answered and explained below. The Associate Data Practitioner practice bank has 1,156 more like it. Try 10 free: instant score, no account.
A data analyst at an e-commerce company wants to build a machine learning model to predict customer lifetime spending using tabular transaction data stored in BigQuery. The analyst needs to follow the standard machine learning lifecycle directly within the data warehouse using SQL statements.
Which sequence of BigQuery ML SQL statements correctly follows the end-to-end lifecycle to train the model, assess its regression performance metrics (such as Mean Squared Error), and generate predictions on new customer records?
CREATE MODEL to train the model, run ML.EVALUATE to analyze evaluation metrics, and run ML.PREDICT to generate predictions on new data.BigQuery ML (BQML) allows data professionals to build, operationalize, and manage machine learning models directly inside Google BigQuery using standard SQL queries. This avoids the latency and complexity of exporting large datasets to external machine learning frameworks.
CREATE MODEL): Defines the model type (such as linear_reg or boosted_tree_regressor), target label, and feature columns to train the model on data stored in BigQuery tables.ML.EVALUATE): Evaluates the trained model against test data to calculate statistical metrics such as Mean Squared Error (MSE), Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), and R-squared for regression tasks.ML.PREDICT): Applies the trained model to new or unseen feature data to generate predicted values directly in SQL query results.
ML.EVALUATE) automatically compute appropriate metrics based on model type.Following the sequence of CREATE MODEL → ML.EVALUATE → ML.PREDICT represents the canonical, Google-recommended pattern for executing the standard ML project lifecycle inside BigQuery ML.
CREATE MODEL to train the model, run ML.CONFUSION_MATRIX to assess regression error metrics, and run ML.CLASSIFY to generate predictions on new data.This option proposes using CREATE MODEL followed by ML.CONFUSION_MATRIX for evaluation and ML.CLASSIFY for inference.
ML.CONFUSION_MATRIX is designed exclusively for classification models (such as logistic regression or multi-class boosted trees) to evaluate true positives, false positives, true negatives, and false negatives. It cannot evaluate numerical regression models or produce Mean Squared Error (MSE).ML.PREDICT as the universal inference function for both regression and classification models; ML.CLASSIFY is not a valid SQL function in BigQuery ML.ML.CONFUSION_MATRIX assesses classification thresholds and class distribution errors.ML.EVALUATE to produce error metrics like MSE, RMSE, and R-squared.The task required evaluating a binary or multiclass classification model (e.g., predicting customer churn or product category) and BigQuery ML had a dedicated ML.CLASSIFY function.
ML.TRAIN to train the model, run ML.VALIDATE to assess performance metrics, and run ML.FORECAST to generate predictions on new data.This option suggests using ML.TRAIN to train the model, ML.VALIDATE to check metrics, and ML.FORECAST for generating general tabular predictions.
CREATE MODEL (or CREATE OR REPLACE MODEL), not ML.TRAIN.ML.EVALUATE to compute statistical metrics; ML.VALIDATE is not a valid BigQuery ML SQL function.ML.FORECAST is a valid BigQuery ML function, it is specifically reserved for time-series forecasting models (such as ARIMA_PLUS), rather than standard supervised regression or classification on tabular customer data.ML.FORECAST generates multi-horizon time-based projections.ML.PREDICT.The requirement specifically involved generating sequential time-series forecasts using an ARIMA model and standard SQL supported ML.TRAIN syntax.
INSERT MODEL to train the model, run ML.SCORE to assess performance metrics, and run ML.EXTRACT to generate predictions on new data.This option proposes using Data Manipulation Language (DML) style INSERT MODEL, ML.SCORE, and ML.EXTRACT to perform training, evaluation, and inference.
INSERT MODEL for machine learning creation; model training requires the CREATE MODEL statement.ML.SCORE is not a valid BigQuery ML function for computing model performance metrics.ML.EXTRACT does not exist as an inference function in BigQuery ML; ML.PREDICT is required to generate predictions on feature datasets.CREATE MODEL.ML. (e.g., ML.EVALUATE, ML.PREDICT, ML.EXPLAIN_PREDICT).BigQuery ML utilized standard database row insertion syntax (INSERT) and scoring commands for model orchestration rather than native SQL DDL and ML evaluation functions.
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