exam questions

Exam Professional Machine Learning Engineer All Questions

View all questions & answers for the Professional Machine Learning Engineer exam

Exam Professional Machine Learning Engineer topic 1 question 167 discussion

Actual exam question from Google's Professional Machine Learning Engineer
Question #: 167
Topic #: 1
[All Professional Machine Learning Engineer Questions]

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?

  • 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.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
vini123
1 month ago
Selected Answer: B
ML.ONE_HOT_ENCODER transforms the categorical features into one-hot encoded values. You then select these encoded categorical features along with the non-categorical features to create your model. This is the most common approach for handling categorical features in BigQuery ML for fast deployment.
upvoted 1 times
...
potomeek
2 months ago
Selected Answer: C
Using the CREATE MODEL statement with the categorical and non-categorical features directly (Option C) is the simplest, fastest, and most effective way to build and deploy your model in BigQuery ML
upvoted 1 times
...
0e6b9e2
2 months, 1 week ago
Selected Answer: C
The create_model statement automatically one-hot encodes categorical features. https://cloud.google.com/bigquery/docs/auto-preprocessing This may not be the best solution in terms of transparency, but the question asked for the "fastest" solution
upvoted 1 times
...
phani49
2 months, 2 weeks ago
Selected Answer: C
BigQuery ML automatically handles categorical features. When you use the CREATE MODEL statement, it recognizes categorical columns and applies appropriate encoding (e.g., one-hot encoding or embeddings) under the hood.
upvoted 3 times
...
YushiSato
7 months ago
Selected Answer: A
TRANSFORM is used to transform the input for both learning and inference. ONE_HOT_ENCODER can also be used within TRANSFORM. The other options require conversion on the input in prediction. A is correct.
upvoted 1 times
YushiSato
7 months ago
Sorry, BlehMaks is correct. In this case, we don't use TRANSFORM, we need to do the conversion in the forecast as well.
upvoted 1 times
...
...
bobjr
9 months, 1 week ago
Selected Answer: A
CREATE OR REPLACE MODEL `project.dataset.model_name` OPTIONS(model_type='logistic_reg') AS SELECT *, TRANSFORM( product_category, payment_method USING ML.ONE_HOT_ENCODER(product_category) AS encoded_product_category, ML.ONE_HOT_ENCODER(payment_method) AS encoded_payment_method ) FROM `project.dataset.table_name`;
upvoted 2 times
...
BlehMaks
1 year, 1 month ago
Selected Answer: B
When the TRANSFORM clause is present, only output columns from the TRANSFORM clause are used in training. Any results from query_statement that don't appear in the TRANSFORM clause are ignored. https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create#transform so if you want TRANSFORM then use TRANSFORM for both categorical and non-categorical features
upvoted 4 times
...
pikachu007
1 year, 2 months ago
Selected Answer: B
Given the goal of quickly deploying the model for predicting customer purchase behavior while handling categorical features, option 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" seems to be the most appropriate. This approach directly handles the encoding of categorical features using one-hot encoding and selects the necessary features for model creation, ensuring efficient utilization of categorical data in the BigQuery ML model.
upvoted 1 times
...
b1a8fae
1 year, 2 months ago
Selected Answer: B
Only B and D make sense. Between the two, after reading the use case of multi-hot encoding (https://cloud.google.com/bigquery/docs/auto-preprocessing#feature-transform), I would tend towards B, since one-hot encoding is preferred over in case of using non-numerical, non-array features (product category and payment methods are often respresented as such); multi-hot encoding is preferred in case of non-numerical, array features, which is not the case here.
upvoted 1 times
b1a8fae
1 year, 2 months ago
Also I understand it cannot be A because it says "take the categorical features" as opposed to the more specific "take the encoded categorical features" in B
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago