Professional Machine Learning Engineer Free Practice Questions — Page 8
Question 72
You are training and deploying updated versions of a regression model with tabular data by using Vertex AI Pipelines, Vertex AI Training, Vertex AI Experiments, and Vertex AI Endpoints. The model is deployed in a Vertex AI endpoint, and your users call the model by using the Vertex AI endpoint. You want to receive an email when the feature data distribution changes significantly, so you can retrigger the training pipeline and deploy an updated version of your model. What should you do?
A. Use Vertex Al Model Monitoring. Enable prediction drift monitoring on the endpoint, and specify a notification email.
B. In Cloud Logging, create a logs-based alert using the logs in the Vertex Al endpoint. Configure Cloud Logging to send an email when the alert is triggered.
C. In Cloud Monitoring create a logs-based metric and a threshold alert for the metric. Configure Cloud Monitoring to send an email when the alert is triggered.
D. Export the container logs of the endpoint to BigQuery. Create a Cloud Function to run a SQL query over the exported logs and send an email. Use Cloud Scheduler to trigger the Cloud Function.
Show Answer
Correct Answer: A
Explanation: Vertex AI Model Monitoring is designed to detect feature distribution drift (prediction drift/data drift) on deployed Vertex AI Endpoints. It can monitor changes in feature distributions, generate alerts, and send email notifications when configured. This directly satisfies the requirement to detect significant distribution changes and trigger retraining, whereas the other options rely on generic logging or custom infrastructure rather than the managed model monitoring capability.
Question 73
You recently created a new Google Cloud project. After testing that you can submit a Vertex AI Pipeline job from the Cloud Shell, you want to use a Vertex AI Workbench user-managed notebook instance to run your code from that instance. You created the instance and ran the code but this time the job fails with an insufficient permissions error. What should you do?
A. Ensure that the Workbench instance that you created is in the same region of the Vertex AI Pipelines resources you will use.
B. Ensure that the Vertex AI Workbench instance is on the same subnetwork of the Vertex AI Pipeline resources that you will use.
C. Ensure that the Vertex AI Workbench instance is assigned the Identity and Access Management (IAM) Vertex AI User role.
D. Ensure that the Vertex AI Workbench instance is assigned the Identity and Access Management (IAM) Notebooks Runner role.
Show Answer
Correct Answer: C
Explanation: A Vertex AI Workbench user-managed notebook submits Vertex AI Pipeline jobs using the identity attached to the notebook VM (or the credentials in use). To create PipelineJobs, that identity needs Vertex AI permissions such as those included in the predefined Vertex AI User role (roles/aiplatform.user). The Notebooks Runner role is intended for running scheduled notebook executions rather than granting permission to submit Vertex AI Pipeline jobs. Region or subnet mismatches would not produce an IAM insufficient permissions error.
Question 74
You are developing an ML model in a Vertex AI Workbench notebook. You want to track artifacts and compare models during experimentation using different approaches. You need to rapidly and easily transition successful experiments to production as you iterate on your model implementation. What should you do?
A. 1. Initialize the Vertex SDK with the name of your experiment. Log parameters and metrics for each experiment, and attach dataset and model artifacts as inputs and outputs to each execution. 2. After a successful experiment create a Vertex AI pipeline.
B. 1. Initialize the Vertex SDK with the name of your experiment. Log parameters and metrics for each experiment, save your dataset to a Cloud Storage bucket, and upload the models to Vertex AI Model Registry. 2. After a successful experiment, create a Vertex AI pipeline.
C. 1. Create a Vertex AI pipeline with parameters you want to track as arguments to your PipelineJob. Use the Metrics, Model, and Dataset artifact types from the Kubeflow Pipelines DSL as the inputs and outputs of the components in your pipeline. 2. Associate the pipeline with your experiment when you submit the job.
D. 1. Create a Vertex AI pipeline. Use the Dataset and Model artifact types from the Kubeflow Pipelines DSL as the inputs and outputs of the components in your pipeline. 2. In your training component, use the Vertex AI SDK to create an experiment run. Configure the log_params and log_metrics functions to track parameters and metrics of your experiment.
Show Answer
Correct Answer: A
Explanation: Vertex AI Experiments is designed for interactive experimentation in Vertex AI Workbench. Initializing the SDK with an experiment, logging parameters and metrics, and attaching dataset/model artifacts to executions enables artifact tracking and model comparison. Once an approach is validated, converting it into a Vertex AI Pipeline is the recommended path to production. The other options either require unnecessary manual artifact management or start with pipelines rather than supporting the notebook-based experimentation workflow.
Question 75
You are developing a model to help your company create more targeted online advertising campaigns. You need to create a dataset that you will use to train the model. You want to avoid creating or reinforcing unfair bias in the model. What should you do? (Choose two.)
A. Include a comprehensive set of demographic features
B. Include only the demographic groups that most frequently interact with advertisements
C. Collect a random sample of production traffic to build the training dataset
D. Collect a stratified sample of production traffic to build the training dataset
E. Conduct fairness tests across sensitive categories and demographics on the trained model
Show Answer
Correct Answer: D, E
Explanation: A stratified sample helps ensure relevant groups are represented in the training data, reducing the risk of underrepresentation and bias. Fairness testing across sensitive categories is a key practice to detect and mitigate disparate model behavior before deployment. Including comprehensive demographic features is not inherently appropriate for training and can introduce or reinforce bias if misused, while limiting data to the most frequent groups or relying only on a random sample can leave minority groups underrepresented.
Sources:
https://cloud.google.com/vertex-ai/docs/evaluation/model-bias-metrics
Question 76
You want to migrate a scikit-learn classifier model to TensorFlow. You plan to train the TensorFlow classifier model using the same training set that was used to train the scikit-learn model, and then compare the performances using a common test set. You want to use the Vertex AI Python SDK to manually log the evaluation metrics of each model and compare them based on their F1 scores and confusion matrices. How should you log the metrics?
A. Use the aiplatform.log_classification_metrics function to log the F1 score, and use the aiplatform.log_metrics function to log the confusion matrix.
B. Use the aiplatform.log_classification_metrics function to log the F1 score and the confusion matrix.
C. Use the aiplatform.log_metrics function to log the F1 score and the confusion matrix.
D. Use the aiplatform.log_metrics function to log the F1 score: and use the aiplatform.log_classification_metrics function to log the confusion matrix.
Show Answer
Correct Answer: D
Explanation: Use aiplatform.log_metrics for scalar numeric metrics such as F1 score. Use aiplatform.log_classification_metrics for classification-specific artifacts such as the confusion matrix (and ROC curve). The classification logging API is intended for structured evaluation artifacts rather than arbitrary scalar metrics.
Question 77
You created a model that uses BigQuery ML to perform linear regression. You need to retrain the model on the cumulative data collected every week. You want to minimize the development effort and the scheduling cost. What should you do?
A. Use BigQuery’s scheduling service to run the model retraining query periodically.
B. Create a pipeline in Vertex AI Pipelines that executes the retraining query, and use the Cloud Scheduler API to run the query weekly.
C. Use Cloud Scheduler to trigger a Cloud Function every week that runs the query for retraining the model.
D. Use the BigQuery API Connector and Cloud Scheduler to trigger Workflows every week that retrains the model.
Show Answer
Correct Answer: A
Explanation: BigQuery ML models are trained with SQL queries, and BigQuery provides built-in scheduled queries that can run retraining statements on a recurring schedule. This requires the least development effort and avoids introducing additional services such as Vertex AI Pipelines, Cloud Functions, or Workflows, minimizing both operational complexity and scheduling cost.
Question 78
You work for an organization that operates a streaming music service. You have a custom production model that is serving a “next song” recommendation based on a user's recent listening history. Your model is deployed on a Vertex AI endpoint. You recently retrained the same model by using fresh data. The model received positive test results offline. You now want to test the new model in production while minimizing complexity. What should you do?
A. Create a new Vertex AI endpoint for the new model and deploy the new model to that new endpoint. Build a service to randomly send 5% of production traffic to the new endpoint. Monitor end-user metrics such as listening time. If end-user metrics improve between models over time, gradually increase the percentage of production traffic sent to the new endpoint.
B. Capture incoming prediction requests in BigQuery. Create an experiment in Vertex AI Experiments. Run batch predictions for both models using the captured data. Use the user’s selected song to compare the models performance side by side. If the new model’s performance metrics are better than the previous model, deploy the new model to production.
C. Deploy the new model to the existing Vertex AI endpoint. Use traffic splitting to send 5% of production traffic to the new model. Monitor end-user metrics, such as listening time. If end-user metrics improve between models over time, gradually increase the percentage of production traffic sent to the new model.
D. Configure a model monitoring job for the existing Vertex AI endpoint. Configure the monitoring job to detect prediction drift and set a threshold for alerts. Update the model on the endpoint from the previous model to the new model. If you receive an alert of prediction drift, revert to the previous model.
Show Answer
Correct Answer: C
Explanation: Deploy the new model to the existing Vertex AI endpoint and use Vertex AI's built-in traffic splitting to perform a canary rollout. Sending a small percentage (for example, 5%) of production traffic to the new model allows you to compare real-world business metrics such as listening time while minimizing operational complexity. Gradually increase traffic if the new model performs better. Creating a separate endpoint requires extra routing infrastructure, offline batch evaluation does not validate live user behavior, and model monitoring for drift is not a replacement for controlled model rollout.
Question 79
You work for a company that is developing an application to help users with meal planning. You want to use machine learning to scan a corpus of recipes and extract each ingredient (e.g., carrot, rice, pasta) and each kitchen cookware (e.g., bowl, pot, spoon) mentioned. Each recipe is saved in an unstructured text file. What should you do?
A. Create a text dataset on Vertex AI for entity extraction Create two entities called “ingredient” and “cookware”, and label at least 200 examples of each entity. Train an AutoML entity extraction model to extract occurrences of these entity types. Evaluate performance on a holdout dataset.
B. Create a multi-label text classification dataset on Vertex AI. Create a test dataset, and label each recipe that corresponds to its ingredients and cookware. Train a multi-class classification model. Evaluate the model’s performance on a holdout dataset.
C. Use the Entity Analysis method of the Natural Language API to extract the ingredients and cookware from each recipe. Evaluate the model's performance on a prelabeled dataset.
D. Create a text dataset on Vertex AI for entity extraction. Create as many entities as there are different ingredients and cookware. Train an AutoML entity extraction model to extract those entities. Evaluate the model’s performance on a holdout dataset.
Show Answer
Correct Answer: A
Explanation: The task is custom named entity extraction from unstructured recipe text. The correct approach is to create a Vertex AI text entity extraction dataset, define the entity types 'ingredient' and 'cookware', label examples, train an AutoML entity extraction model, and evaluate it on a holdout set. Entity extraction models learn entity types (such as ingredient and cookware), not every possible ingredient or utensil value. Multi-label classification is the wrong task because it labels whole documents rather than spans of text. The Natural Language API's prebuilt entity analysis is general-purpose and does not let you train custom entity types for this domain.
Question 80
You work for a retail company. You have been tasked with building a model to determine the probability of churn for each customer. You need the predictions to be interpretable so the results can be used to develop marketing campaigns that target at-risk customers. What should you do?
A. Build a random forest regression model in a Vertex AI Workbench notebook instance. Configure the model to generate feature importances after the model is trained.
B. Build an AutoML tabular regression model. Configure the model to generate explanations when it makes predictions.
C. Build a custom TensorFlow neural network by using Vertex AI custom training. Configure the model to generate explanations when it makes predictions.
D. Build a random forest classification model in a Vertex AI Workbench notebook instance. Configure the model to generate feature importances after the model is trained.
Show Answer
Correct Answer: D
Explanation: Customer churn is fundamentally a binary classification problem. A classification model can output the probability that a customer belongs to the churn class. Among the options, a random forest classification model provides strong performance and feature importance scores, which are directly useful for interpreting which factors drive churn and informing marketing campaigns. The regression options mischaracterize the prediction task, and while neural networks can provide explanations, they are generally less inherently interpretable than a random forest with feature importances.
Question 81
You are developing a custom TensorFlow classification model based on tabular data. Your raw data is stored in BigQuery. contains hundreds of millions of rows, and includes both categorical and numerical features. You need to use a MaxMin scaler on some numerical features, and apply a one-hot encoding to some categorical features such as SKU names. Your model will be trained over multiple epochs. You want to minimize the effort and cost of your solution. What should you do?
A. 1. Write a SQL query to create a separate lookup table to scale the numerical features. 2. Deploy a TensorFlow-based model from Hugging Face to BigQuery to encode the text features. 3. Feed the resulting BigQuery view into Vertex AI Training.
B. 1. Use BigQuery to scale the numerical features. 2. Feed the features into Vertex AI Training. 3. Allow TensorFlow to perform the one-hot text encoding.
C. 1. Use TFX components with Dataflow to encode the text features and scale the numerical features. 2. Export results to Cloud Storage as TFRecords. 3. Feed the data into Vertex AI Training.
D. 1. Write a SQL query to create a separate lookup table to scale the numerical features. 2. Perform the one-hot text encoding in BigQuery. 3. Feed the resulting BigQuery view into Vertex AI Training.
Show Answer
Correct Answer: C
Explanation: TFX Transform is designed to compute and apply consistent full-pass preprocessing (such as min-max scaling and vocabulary/one-hot encoding) at large scale. Running preprocessing once, materializing TFRecords, and reusing them across multiple training epochs avoids repeatedly executing expensive transformations and keeps training and serving preprocessing consistent. BigQuery SQL can perform these operations, but maintaining stateful transforms and consistency is more complex for ML pipelines.
$19
Get all 332 questions with detailed answers and explanations
Instant download HTML + PDF delivered the moment payment clears.
Secure Stripe checkout we never see or store your card details.
7-day refund if files are defective see our refund policy.