PROFESSIONAL-MACHINE-LEARNING-ENGINEER practice question 22 of 35

You work for a retail company. You have been asked to develop a model to predict whether a customer will purchase a product on a given day. Your team…

Full set: 283 questions
You work for a retail company. You have been asked to develop a model to predict whether a customer will purchase a product on a given day. Your team has processed the company's sales data, and created a table with the following rows: • Customer_id • Product_id • Date • Days_since_last_purchase (measured in days) • Average_purchase_frequency (measured in 1/days) • Purchase (binary class, if customer purchased product on the Date) You need to interpret your models results for each individual prediction. What should you do?
Answer options
A: Create a BigQuery table Use BigQuery ML to build a boosted tree classifier Inspect the partition rules of the trees to understand how each prediction flows through the trees.
B: Create a Vertex Al tabular dataset Train an AutoML model to predict customer purchases Deploy the model to a Vertex Al endpoint and enable feature attributions Use the "explain" method to get feature attribution values for each individual prediction. Correct answer
C: Create a BigQuery table Use BigQuery ML to build a logistic regression classification model Use the values of the coefficients of the model to interpret the feature importance with higher values corresponding to more importance.
D: Create a Vertex Al tabular dataset Train an AutoML model to predict customer purchases Deploy the model to a Vertex Al endpoint. At each prediction enable L1 regularization to detect non- informative features.
Correct Answer:
B. Create a Vertex Al tabular dataset Train an AutoML model to predict customer purchases Deploy the model to a Vertex Al endpoint and enable feature attributions Use the "explain" method to get feature attribution values for each individual prediction.
Explanation

The core requirement is to interpret the model's results for each individual prediction. This necessitates a method for local, or instance-level, explainability. Vertex AI Explainable AI is specifically designed for this purpose. By training a model (such as with AutoML), deploying it to an endpoint, and enabling feature attributions, you can use the explain request. This returns attribution scores (e.g., using methods like Sampled SHAP) for each feature, indicating how much that feature contributed to a specific prediction. This directly addresses the need to understand the "why" behind each individual classification.

Why Incorrect

A: Manually inspecting partition rules in a boosted tree ensemble is highly impractical and does not provide a clear, quantitative attribution for each feature's influence on a single prediction. C: The coefficients of a logistic regression model provide global feature importance. They explain the average effect of a feature across all predictions, not why a specific prediction was made. D: L1 regularization is a technique applied during model training to encourage feature sparsity and prevent overfitting. It is not a method used at prediction time to interpret individual results.

References

1. Vertex AI Documentation - Get explanations: This official documentation explicitly states, "You can get feature attributions on your Vertex AI models to help you understand your model's outputs for specific predictions." It details the process of deploying a model and sending an explain request to get instance-level attributions.

Source: Google Cloud, "Get explanations", Vertex AI Documentation.

Reference: See the "Get online explanations" section, which describes making a projects.locations.endpoints.explain request.

2. Vertex AI Documentation - Overview of Vertex AI Explainable AI: This document introduces the concept of feature attributions for understanding model predictions. It clarifies, "For a given prediction, feature attributions tell you how much each feature in your model contributed to the prediction." This confirms its suitability for interpreting individual predictions.

Source: Google Cloud, "Overview of Vertex AI Explainable AI", Vertex AI Documentation.

Reference: See the "Understanding feature attributions" section.

3. BigQuery ML Documentation - Model weights for logistic regression: The ML.WEIGHTS function in BigQuery ML returns the coefficients for linear and logistic regression models. The documentation describes these as representing the overall learned weights, which is a form of global explanation, not local.

Source: Google Cloud, "The ML.WEIGHTS function", BigQuery ML Documentation.

Reference: The function description explains it returns the weights learned during training.

4. Stanford University CS229 Course Notes - Regularization and Model Selection: This courseware explains that L1 regularization adds a penalty term to the loss function during training to drive some feature weights to zero, thus performing feature selection. This confirms it is a training-time procedure, not a prediction-time interpretation tool.

Source: Ng, A. (2023). CS229 Machine Learning Course Notes. Stanford University.

Reference: Section on "Regularization and Model Selection".

Scroll to Top