Google
PROFESSIONAL-MACHINE-LEARNING-ENGINEER · Question #117
You are building a linear regression model on BigQuery ML to predict a customer's likelihood of purchasing your company's products. Your model uses a city name variable as a key predictive component.
The correct answer is D. Use Dataprep to transform the state column using a one-hot encoding method, and make each. One-hot is a good way to use categorical variables in regressions problems https://academic.oup.com/rheumatology/article/54/7/1141/1849688 https://cloud.google.com/bigquery-ml/docs/reference/standard-sql/bigqueryml-auto-preprocessing
Submitted by ashley.k· Apr 18, 2026Data processing and feature engineering
Question
You are building a linear regression model on BigQuery ML to predict a customer's likelihood of purchasing your company's products. Your model uses a city name variable as a key predictive component. In order to train and serve the model, your data must be organized in columns. You want to prepare your data using the least amount of coding while maintaining the predictable variables. What should you do?
Options
- AUse TensorFlow to create a categorical variable with a vocabulary list. Create the vocabulary file,
- BCreate a new view with BigQuery that does not include a column with city information
- CUse Cloud Data Fusion to assign each city to a region labeled as 1, 2, 3, 4, or 5, and then use
- DUse Dataprep to transform the state column using a one-hot encoding method, and make each
How the community answered
(32 responses)- A9% (3)
- B3% (1)
- C19% (6)
- D69% (22)
Explanation
One-hot is a good way to use categorical variables in regressions problems https://academic.oup.com/rheumatology/article/54/7/1141/1849688 https://cloud.google.com/bigquery-ml/docs/reference/standard-sql/bigqueryml-auto-preprocessing
Topics
#Feature Engineering#Categorical Data Encoding#Google Cloud Dataprep#Data Preprocessing
Community Discussion
No community discussion yet for this question.