Skip to main content

DP-100 Real Exam Questions

Designing and Implementing a Data Science Solution on Azure

617 questions available · Page 1 of 62

Updated Exam DumpsVerified AnswersPass Guarantee

Get Complete Exam Dumps
Question 1 Hotspot

HOTSPOT

You load data from a notebook in an Azure Machine Learning workspace into a pandas dataframe. The data contains 10,000 records. Each record consists of 10 columns.

You must identify the number of missing values in each of the columns.

You need to complete the Python code that will return the number of missing values in each of the columns.

Which code segments should you use? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Question diagram
Show answer and explanation
Correct answer diagram
Explanation

Explanation:

Box 1: values
pandas.DataFrame.values
property DataFrame.values[source]
Return a Numpy representation of the DataFrame.

Warning
We recommend using DataFrame.to_numpy() instead.

Only the values in the DataFrame will be returned, the axes labels will be removed.

Incorrect:

* index
pandas.DataFrame.index
DataFrame.index
The index (row labels) of the DataFrame.

* shape
pandas.DataFrame.shape
property DataFrame.shape[source]
Return a tuple representing the dimensionality of the DataFrame.

See also
ndarray.shape
Tuple of array dimensions.

Box 2: 10
pandas.DataFrame.count
DataFrame.count(axis=0, numeric_only=False)[source]
Count non-NA cells for each column or row.

The values None, NaN, NaT, and optionally numpy.inf (depending on pandas.options.mode.use_inf_as_na) are considered NA.

References:
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.values.html

Question 2 Single choice

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.

After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.

You have a Python script named train.py in a local folder named scripts. The script trains a regression model by using scikit-learn. The script includes code to load a training data file which is also located in the scripts folder.

You must run the script as an Azure ML experiment on a compute cluster named aml-compute.

You need to configure the run to ensure that the environment includes the required packages for model training. You have instantiated a variable named aml-compute that references the target compute cluster.

Solution: Run the following code:

Does the solution meet the goal?

  1. A

    Yes

  2. B

    No

Show answer and explanation

Correct answer: B

Explanation

The scikit-learn estimator provides a simple way of launching a scikit-learn training job on a compute target. It is implemented through the SKLearn class, which can be used to support single-node CPU training.

Example:
from azureml.train.sklearn import SKLearn

}

estimator = SKLearn(source_directory=project_folder,
compute_target=compute_target,
entry_script='train_iris.py'
)

References:
https://docs.microsoft.com/en-us/azure/machine-learning/how-to-train-scikit-learn

Question 3 Single choice

You have an Azure Machine Learning workspace named WS1.

You plan to use Azure Machine Learning SDK v2 to register a model as an asset in WS1 from an artifact generated by an MLflow run. The artifact resides in a named output of a job used for the model training.

You need to identify the syntax of the path to reference the model when you register it.

Which syntax should you use?

  1. A

    t//model/

  2. B

    azureml://registries

  3. C

    mlflow-model/

  4. D

    azureml://jobs/

Show answer and explanation

Correct answer: D

Question 4 Hotspot

HOTSPOT

You create an Azure Machine Learning workspace. You use the Azure Machine Learning Python SDK v2 to create a compute cluster.

The compute cluster must run a training script. Costs associated with running the training script must be minimized.

You need to complete the Python script to create the compute cluster.

How should you complete the script? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Question diagram
Show answer and explanation
Correct answer diagram
Explanation

Explanation:

Box 1: AmlCompute
Create compute cluster, Python SDK v2

Example:
from azure.ai.ml.entities import AmlCompute
cpu_cluster_name = "cpucluster"
cluster_basic = AmlCompute(
name=cpu_cluster_name,
type="amlcompute",
size="STANDARD_DS3_v2",
max_instances=4, # Minimum running nodes when there is no job running min_instances=0
) ml_client.begin_create_or_update(cluster_basic)

Box 2: min_instances=0
Incorrect:
* tier= "LowPriority"
* min_instances=1

References:
https://learn.microsoft.com/en-us/azure/machine-learning/migrate-to-v2-resource-compute
https://learn.microsoft.com/en-us/azure/machine-learning/tutorial-train-model

Question 5 Hotspot

HOTSPOT

You are working on a classification task. You have a dataset indicating whether a student would like to play soccer and associated attributes. The dataset includes the following columns:

You need to classify variables by type.

Which variable should you add to each category? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Question diagram
Show answer and explanation
Correct answer diagram
Explanation

References:
https://www.edureka.co/blog/classification-algorithms/

Question 6 Drag & drop

DRAG DROP

You are managing an Azure Machine Learning workspace.

You must tune a hyperparameter for a neural network model. The learning rate must be a continuous hyperparameter between 0.001 and 0.1. The batch size can be 32, 64, or 128.

You need to select the appropriate search space for each parameter.

Which search space should you use? To answer, move the appropriate search spaces to the correct hyperparameters. You may use each search space option once, more than once, or not at all. You may need to move the split bar between panes or scroll to view content.

NOTE: Each correct selection is worth one point.

Question diagram
Show answer and explanation
Correct answer diagram
Question 7 Hotspot

HOTSPOT

You have a Python data frame named salesData in the following format:

The data frame must be unpivoted to a long data format as follows:

You need to use the pandas.melt() function in Python to perform the transformation.

How should you complete the code segment? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

stem image

Question diagram
Show answer and explanation
Correct answer diagram
Explanation

Box 1: dataFrame
Syntax: pandas.melt(frame, id_vars=None, value_vars=None, var_name=None, value_name='value',
col_level=None)[source]

Where frame is a DataFrame

Box 2: shop
Paramter id_vars id_vars : tuple, list, or ndarray, optional Column(s) to use as identifier variables.

Box 3: ['2017','2018']
value_vars : tuple, list, or ndarray, optional Column(s) to unpivot. If not specified, uses all columns that are not set as id_vars.

Example:
df = pd.DataFrame({'A': {0: 'a', 1: 'b', 2: 'c'},
... 'B': {0: 1, 1: 3, 2: 5},
... 'C': {0: 2, 1: 4, 2: 6}})

pd.melt(df, id_vars=['A'], value_vars=['B', 'C'])
A variable value
0 a B 1
1 b B 3
2 c B 5
3 a C 2
4 b C 4
5 c C 6

References:
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.melt.html

Question 8 Single choice

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.

After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.

You plan to use a Python script to run an Azure Machine Learning experiment. The script creates a reference to the experiment run context, loads data from a file, identifies the set of unique values for the label column, and completes the experiment run:

from azureml.core import Run
import pandas as pd
run = Run.get_context()
data = pd.read_csv('data.csv')
label_vals = data['label'].unique()
# Add code to record metrics here run.complete()

The experiment must record the unique labels in the data as metrics for the run that can be reviewed later.

You must add code to the script to record the unique label values as run metrics at the point indicated by the comment.

Solution: Replace the comment with the following code:

run.log_list('Label Values', label_vals) Does the solution meet the goal?

  1. A

    Yes

  2. B

    No

Show answer and explanation

Correct answer: A

Explanation

run.log_list log a list of values to the run with the given name using log_list.

Example: run.log_list("accuracies", [0.6, 0.7, 0.87])

Note:
Data= pd.read_csv('data.csv')
Data is read into a pandas.DataFrame, which is a two-dimensional, size-mutable, potentially heterogeneous tabular data.

label_vals =data['label'].unique label_vals contains a list of unique label values.

References:
https://www.element61.be/en/resource/azure-machine-learning-services-complete-toolbox-ai
https://docs.microsoft.com/en-us/python/api/azureml-core/azureml.core.run(class)
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html

Question 9 Single choice

You manage an Azure Machine Learning Workspace named Workspace1 and an Azure Files share named Share1.

You plan to create an Azure Files datastore in Workspace1 to target Share1.
You need to configure permanent access to Share1 from the Azure Files datastore.

Which authorization method should you use?

  1. A

    Primary access key

  2. B

    Anonymous access

  3. C

    Account SAS key

  4. D

    User delegation SAS key

Show answer and explanation

Correct answer: C

Question 10 Single choice

You are reviewing model benchmarks in Azure Al Foundry.

You must use a large language model based on the proficiency of the model to generate the most linguistically correct text.

You need to select the model benchmark.

Which benchmark metric should you focus on?

  1. A

    fluency

  2. B

    coherence

  3. C

    precision

  4. D

    accuracy

Show answer and explanation

Correct answer: A