Google Cloud Professional Machine Learning Engineer — Question 164
You are working with a dataset that contains customer transactions. You need to build an ML model to predict customer purchase behavior. You plan to develop the model in BigQuery ML, and export it to Cloud Storage for online prediction. You notice that the input data contains a few categorical features, including product category and payment method. You want to deploy the model as quickly as possible. What should you do?
Answer options
- 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.
- 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.
Correct answer: C
Explanation
The correct answer is C because using the CREATE MODEL statement allows you to directly specify both categorical and non-categorical features without needing transformations. Options A and B involve additional encoding steps that may slow down the deployment process, while option D suggests using the ML.MULTI_HOT_ENCODER, which is not necessary in this context and does not align with the goal of a quick deployment.