Which BigQuery ML Algorithm and Preprocessing Best Predicts Retail Sales?

You work at a retail company, and are tasked with developing an ML model to predict product sales. Your company’s historical sales data is stored in BigQuery and includes features such as date, store location, product category, and promotion details. You need to choose the most effective combination of a BigQuery ML model and feature engineering to maximize prediction accuracy. What should you do?

  1. Use a linear regression model. Perform one-hot encoding on categorical features, and create additional features based on the date, such as day of the week or month.
  2. Use a boosted tree model. Perform label encoding on categorical features, and transform the date column into numeric values. Source Reference Answer
  3. Use an autoencoder model. Perform label encoding on categorical features, and normalize the date column.
  4. Use a matrix factorization model. Perform one-hot encoding on categorical features, and create interaction features between the store location and product category variables.

Community Votes

B
50%
A
50%

50% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

Tests model selection for tabular prediction tasks, with the common trap being favoring computationally efficient linear models over boosted trees that deliver superior accuracy on complex sales data.

This question evaluates selecting the optimal BigQuery ML algorithm and preprocessing pipeline for tabular sales forecasting. While the community split evenly between linear regression and boosted trees, official guidance prioritizes gradient-boosted decision trees for capturing non-linear retail patterns.

Option A (Linear Regression) was selected by half the voters because its straightforward date feature engineering appears more intuitive, but it lacks the capacity to model non-linear promotional effects and seasonal demand spikes accurately.

Community Discussion (3 comments)

Wuthuong1234 👍 3 Selected: A
I would only consider between A and B. I think A is more likely since that option makes better use of the date field, which is arguably the more "efficient" approach. Linear regression tends to be more efficient than boosted trees too.
Long_Pham 👍 1 Selected: A
I think A, because boosted trees are effective, but in most cases, they rarely transform date columns into numeric values.
strafer 👍 4 Selected: B
B. Use a boosted tree model. Perform label encoding on categorical features, and transform the date column into numeric values.

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

Boosted tree models excel at tabular data with mixed feature types and non-linear relationships, making them ideal for sales forecasting. Label encoding efficiently handles categorical features without exploding dimensionality, while converting dates to numeric formats allows tree splits to learn temporal trends effectively. BigQuery ML’s BOOSTED_TREE implementation automatically handles missing values and scales well for production-grade predictions.

Why the Other Options Are Wrong

Linear regression assumes linear relationships and struggles with complex promotional effects and seasonal spikes common in retail datasets. Autoencoders are unsupervised generative models used for anomaly detection or dimensionality reduction, not supervised sales forecasting. Matrix factorization is designed for collaborative filtering in recommendation engines, not structured tabular sales prediction, and interaction features alone cannot compensate for the mismatched algorithm.

Community Comment Notes

The voting split highlights a classic exam dilemma between efficiency and accuracy. Comment [2] correctly notes linear regression’s efficiency but overlooks that exam scenarios prioritize predictive performance for business-critical tasks like revenue forecasting. Comment [3] questions date transformation in boosted trees, yet numeric conversion remains standard practice for temporal feature ingestion in tree-based algorithms. Overall, the community debate underscores the importance of aligning model choice with the primary objective: maximizing accuracy.

Official Reference

Exam Strategy

Always match the algorithm to the primary goal: choose boosted trees or random forests for tabular accuracy, and reserve linear models only when interpretability or training speed is explicitly prioritized. When feature engineering options are paired with models, verify that the preprocessing step aligns with how the algorithm internally processes inputs rather than defaulting to familiar techniques.

Related Analysis

Practice All PMLE Questions

Access 65 questions with complete answers and detailed explanations.

View Full PMLE Practice Test →

← Back to PMLE Study Guide