Question 7
Domain 1You are tasked with a dataset that encompasses customer transactions, and your objective is to construct an ML model for forecasting customer purchase patterns. Your plan involves creating the model within BigQuery ML and subsequently exporting it to Cloud Storage for online prediction. Upon reviewing the data, you observe the presence of categorical features such as product category and payment method. Your priority is to deploy the model swiftly. What steps should you take to achieve this goal?
Correct answer: C
Explanation
BigQuery ML lets you build models directly with the `CREATE MODEL` statement, which is the fastest path to deployment because it avoids separate training infrastructure. Including both categorical and non-categorical features ensures the model can learn from all available transaction signals, such as product category and payment method, for purchase forecasting.
Why each option is right or wrong
A. Use the TRANSFORM clause with the ML.ONE_HOT_ENCODER function on the categorical features at model creation and select the categorical and non-categorical features.
B. Use the ML.ONE_HOT_ENCODER function on the categorical features and select the encoded categorical features and non-categorical features as inputs to create your model.
C. Use the CREATE MODEL statement and select the categorical and non-categorical features.
BigQuery ML is designed for in-database training, so the `CREATE MODEL` statement is the direct path when speed matters; it avoids provisioning separate training infrastructure and lets you train from the transaction table immediately. For this dataset, the categorical fields must be included as features alongside the numeric ones so the model can learn from product category and payment method rather than discarding them; BigQuery ML handles these feature types in the training query, and the resulting model can then be exported to Cloud Storage for prediction use.
D. Use the ML.MULTI_HOT_ENCODER function on the categorical features and select the encoded categorical features and non-categorical features as inputs to create your model.