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 a retail company trained a time-series model named sales_data.daily_revenue_model using the ARIMA_PLUS model type in BigQuery ML. The business team needs to project future daily sales for the next 30 days with an 80% prediction interval.
Which BigQuery ML SQL query should the analyst run to generate these future values?
sales_data.daily_revenue_model, STRUCT(30 AS days, 80 AS confidence))ML.PREDICT is the general BigQuery ML inference function used for supervised classification, regression, and deep learning models. It evaluates features from an input table or subquery against a trained model to generate point predictions for each input row.
ML.PREDICT can be used across various machine learning models, ML.FORECAST is the dedicated function designed specifically for generating future time-series values with horizon and confidence intervals without supplying an explicit future feature table.days or confidence inside a STRUCT for time-series configuration; the standard parameters are horizon and confidence_level.0.0 and 1.0 (e.g., 0.8), not whole numbers like 80.ML.FORECAST does.The scenario involved generating point estimates or class probabilities on an existing tabular dataset using standard regression or classification models (such as LOGISTIC_REG or BOOSTED_TREE_REGRESSOR).
sales_data.daily_revenue_model, STRUCT(30 AS forecast_period, 0.8 AS threshold))ML.EVALUATE is a model assessment function in BigQuery ML that computes statistical performance metrics (such as MAE, MSE, RMSE, MAPE, or log loss) to determine how well a model fits training or test evaluation data.
ML.EVALUATE produces assessment statistics (e.g., mean absolute percentage error, AIC, variance) to validate model accuracy, rather than generating prospective revenue predictions.forecast_period and threshold are not valid arguments for configuring prediction horizon and confidence intervals.The analyst needed to assess the statistical accuracy, error rates, and quality metrics of the ARIMA_PLUS model against historical holdout data before utilizing it for operational forecasting.
sales_data.daily_revenue_model, STRUCT(30 AS horizon, 0.8 AS confidence_level))ML.DETECT_ANOMALIES is a BigQuery ML function designed to identify outliers and anomalous data points in historical or new datasets using models such as ARIMA_PLUS, KMEANS, PCA, or AUTOENCODER.
ML.DETECT_ANOMALIES identifies unusual past patterns or historical spikes/dips.ML.DETECT_ANOMALIES typically configures anomaly_prob_threshold (e.g., 0.95) and contamination rates, rather than a forward-looking horizon parameter.is_anomaly), anomaly probabilities, and upper/lower expected boundaries for existing data points rather than future temporal projections.The business requirement asked the analyst to scan historical daily revenue data to find past outlier days or unexpected revenue spikes that deviated significantly from normal trends.
sales_data.daily_revenue_model, STRUCT(30 AS horizon, 0.8 AS confidence_level))ML.FORECAST is a specialized BigQuery ML table-valued function used to perform batch inference on trained time-series models (such as ARIMA_PLUS and ARIMA_PLUS_XREG). It projects future values across a specified temporal range while calculating lower and upper bound prediction intervals directly within SQL queries.
ML.FORECAST executes multi-step ahead time-series forecasting, generating expected values for upcoming timestamps based on learned trends and seasonality.30 AS horizon explicitly instructs the model to predict the next 30 discrete time intervals (days) ahead from the end of the historical training data.0.8 AS confidence_level produces prediction intervals bounded between lower and upper prediction limits at an 80% confidence interval.forecast_value, standard_error, lower_bound, and upper_bound for each step in the horizon.STRUCT, including horizon (default is 30 or 1000 depending on cadence) and confidence_level (between 0.0 and 1.0; default is 0.95).TIME_SERIES_ID_COL parameter.ML.FORECAST is the standard, purpose-built function in BigQuery ML for time-series projections using ARIMA_PLUS. It directly implements the required horizon and confidence parameters with proper decimal formatting (0.8 for 80%), avoiding the overhead of custom inference scripts or general-purpose prediction 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