Microsoft

DP-100 Free Practice Questions — Page 9

Question 87

You plan to use automated machine learning by using Azure Machine Learning Python SDK v2 to train a regression model. You have data that has features with missing values, and categorical features with few distinct values. You need to control whether automated machine learning automatically imputes missing values and encode categorical features as part of the training task. Which enum of the automl package should you use?

A. ForecastHorizonMode
B. RegressionModels
C. FeaturizationMode
D. RegressionPrimaryMetrics
Show Answer
Correct Answer: C
Explanation:
In Azure Machine Learning AutoML (Python SDK v2), control over automatic preprocessing—such as imputing missing values and encoding categorical features—is handled by the FeaturizationMode enum. It lets you choose AUTO (default automatic featurization), CUSTOM (user-defined featurization), or OFF (no featurization). The other enums relate to forecasting configuration, model selection, or evaluation metrics, not preprocessing.

Question 88

DRAG DROP - You create an Azure Machine Learning workspace and an Azure Synapse Analytics workspace with a Spark pool. The workspaces are contained within the same Azure subscription. You must manage the Synapse Spark pool from the Azure Machine Learning workspace. You need to attach the Synapse Spark pool in Azure Machine Learning by using the Python SDK v2. Which three actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.

Illustration for DP-100 question 88
Show Answer
Correct Answer: Create an instance of the azure.ai.ml.MLClient class. Define Spark pool configuration with the SynapseSparkCompute class. Attach the Synapse Spark pool with the azure.ai.ml.MLClient.begin_create_or_update() function.
Explanation:
In SDK v2, you first connect to the Azure ML workspace using MLClient. A Synapse Spark pool is represented as a SynapseSparkCompute resource, which defines the configuration and references the existing Synapse pool. The compute is then attached to the workspace by calling begin_create_or_update().

Question 89

You create an Azure Machine Learning workspace named workspaces. You create a Python SDK v2 notebook to perform custom model training in workspaces. You need to run the notebook from Azure Machine Learning Studio in workspaces. What should you provision first?

A. default storage account
B. real-time endpoint
C. Azure Machine Learning compute cluster
D. Azure Machine Learning compute instance
Show Answer
Correct Answer: D
Explanation:
To run a Python SDK v2 notebook interactively from Azure Machine Learning Studio, you must have an Azure Machine Learning compute instance. A compute instance provides a managed Jupyter notebook environment integrated with the workspace. Compute clusters are used for running training jobs, not for authoring or interactively running notebooks, and the other options are not required for notebook execution.

Question 90

HOTSPOT - You manage an Azure Machine Learning workspace. You submit a training job with the Azure Machine Learning Python SDK v2. You must use MLflow to log metrics, model parameters, and model artifacts automatically when training a model. You start by writing the following code segment: import mlflow mlflow.autolog(log_models=False, exclusive=True) For each of the following statements, select Yes if the statement is true. Otherwise, select No.

Illustration for DP-100 question 90
Show Answer
Correct Answer: No No No
Explanation:
`exclusive=True` prevents autologged content from being logged to a user-created fluent run. `log_models=False` disables logging trained models as MLflow model artifacts. Autologging does not guarantee that *all* metrics and parameters are logged—only those supported by the framework’s autolog implementation.

Question 91

HOTSPOT - You perform hyperparameter tuning with Azure Machine Learning. You create the following Python code: For each of the following statements, select Yes if the statement is true. Otherwise, select No.

Illustration for DP-100 question 91 Illustration for DP-100 question 91
Show Answer
Correct Answer: Yes No Yes
Explanation:
The command_job defines a hyperparameter search space using learning_rate and keep_probability. learning_rate is sampled from a Normal distribution, not a log-normal one, so its logarithm is not normally distributed. keep_probability is explicitly defined with a Uniform distribution between 0.05 and 0.1.

Question 92

You manage an Azure Machine Learning workspace. You must log multiple metrics by using MLflow. You need to maximize logging performance. What are two possible ways to achieve this goal? Each correct answer presents a complete solution. NOTE: Each correct selection is worth one point.

A. MLflowClient.log_batch
B. mlflow.log_metrics
C. mlflow.log_metric
D. mlflow.log_param
Show Answer
Correct Answer: A, B
Explanation:
To maximize logging performance when recording multiple metrics with MLflow, you should minimize the number of logging calls. MLflowClient.log_batch allows you to send metrics (and other entities) to the tracking server in a single batch request, which is more efficient than repeated individual calls. Similarly, mlflow.log_metrics logs multiple metrics at once by accepting a dictionary, avoiding the overhead of looping over mlflow.log_metric calls. Using mlflow.log_metric or mlflow.log_param individually does not provide the same performance benefits.

Question 93

You create a workspace by using Azure Machine Learning Studio. You must run a Python SDK v2 notebook in the workspace by using Azure Machine Learning Studio. You must preserve the current values of variables set in the notebook for the current instance. You need to maintain the state of the notebook. What should you do?

A. Change the compute.
B. Change the current kernel.
C. Stop the compute.
D. Stop the current kernel.
Show Answer
Correct Answer: D
Explanation:
In Azure Machine Learning Studio notebooks, the kernel holds the in-memory execution state, including variables. To maintain the current state while stopping execution, you should stop the current kernel. This pauses execution without restarting or switching the kernel, so existing variables and state are preserved. Changing the kernel, changing compute, or restarting/stopping compute would reset the environment and lose state.

Question 94

DRAG DROP - You have an Azure Machine Learning workspace. You are running an experiment on your local computer. You need to ensure that you can use MLflow Tracking with Azure Machine Learning Python SDK v2 to store metrics and artifacts from your local experiment runs m the workspace. In which order should you perform the actions? To answer, move all actions from the list of actions to the answer area and arrange them in the correct order.

Illustration for DP-100 question 94
Show Answer
Correct Answer: Go to the workspace in the Azure portal. Retrieve the tracking URI of the workspace. Import MLflow and MLClient classes. Set the MLflow tracking URI and the experiment name.
Explanation:
You first access the Azure ML workspace to obtain its MLflow tracking URI. After retrieving the URI, you import the required SDK classes and then configure MLflow locally by setting the tracking URI and experiment name so runs log to the workspace.

Question 95

HOTSPOT - You manage an Azure Machine Learning workspace named workspace1 by using the Python SDK v2. The default datastore of workspace1 contains a folder named sample_data. The folder structure contains the following content: |— sample_data |— MLTable |— file1.txt |— file2.txt |— file3.txt You write Python SDK v2 code to materialize the data from the files in the sample_data folder into a Pandas data frame. You need to complete the Python SDK v2 code to use the MLTable folder as the materialization blueprint. How should you complete the code? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Illustration for DP-100 question 95
Show Answer
Correct Answer: load ./sample_data/MLTable
Explanation:
Use mltable.load to materialize data based on an MLTable blueprint. The path must point to the folder containing the MLTable definition, which describes how to read the files into a Pandas DataFrame.

Question 96

You manage an Azure Machine Learning workspace. You need to define an environment from a Docker image by using the Azure Machine Learning Python SDK v2. Which parameter should you use?

A. properties
B. image
C. build
D. conda_file
Show Answer
Correct Answer: B
Explanation:
In Azure Machine Learning Python SDK v2, when you want to define an environment directly from an existing Docker image, you use the **image** parameter. The **build** parameter is used when defining an environment from a Dockerfile or build context, not from a prebuilt image. Therefore, the correct choice is B.

$19

Get all 477 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.