exam questions

Exam DP-100 All Questions

View all questions & answers for the DP-100 exam

Exam DP-100 topic 3 question 101 discussion

Actual exam question from Microsoft's DP-100
Question #: 101
Topic #: 3
[All DP-100 Questions]

You use the following code to define the steps for a pipeline: from azureml.core import Workspace, Experiment, Run from azureml.pipeline.core import Pipeline from azureml.pipeline.steps import PythonScriptStep ws = Workspace.from_config()
. . .
step1 = PythonScriptStep(name="step1", ...)
step2 = PythonScriptsStep(name="step2", ...)
pipeline_steps = [step1, step2]
You need to add code to run the steps.
Which two code segments can you use to achieve this goal? Each correct answer presents a complete solution.
NOTE: Each correct selection is worth one point.

  • A. experiment = Experiment(workspace=ws, name='pipeline-experiment') run = experiment.submit(config=pipeline_steps)
  • B. run = Run(pipeline_steps)
  • C. pipeline = Pipeline(workspace=ws, steps=pipeline_steps) experiment = Experiment(workspace=ws, name='pipeline-experiment') run = experiment.submit(pipeline)
  • D. pipeline = Pipeline(workspace=ws, steps=pipeline_steps) run = pipeline.submit(experiment_name='pipeline-experiment')
Show Suggested Answer Hide Answer
Suggested Answer: CD 🗳️

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
pancman
Highly Voted 2 years, 8 months ago
The given answer of C & D is correct. Some people commented that they think it should be A & C. Don't let this confuse you as answer A is certainly wrong. You can't use [step1, step2] as a config to experiment submit, as given in the answer A. You need to create a pipeline object and provide it as the config. Refer to experiment class for proof: https://docs.microsoft.com/en-us/python/api/azureml-core/azureml.core.experiment(class)?view=azure-ml-py#azureml-core-experiment-submit
upvoted 20 times
Matt2000
10 months ago
References: https://learn.microsoft.com/en-us/python/api/azureml-pipeline-core/azureml.pipeline.core.pipeline(class)?view=azure-ml-py https://learn.microsoft.com/en-us/python/api/azureml-core/azureml.core.experiment(class)?view=azure-ml-py#azureml-core-experiment-submit
upvoted 1 times
...
azurelearner666
2 years, 8 months ago
Thanks for clarifying!
upvoted 2 times
...
...
avinyc
Most Recent 5 months, 1 week ago
Selected Answer: CD
Options C and D
upvoted 1 times
...
haby
11 months, 4 weeks ago
Selected Answer: C
C for me. For A, you can't submit [step1, step2] parameters only; For D, you can't submit a string name only. Correct way is to submit Pipeline Obj or RunConfig Obj, not a list or string.
upvoted 1 times
...
PI_Team
1 year ago
Selected Answer: C
Only option C is correct Options A and B are incorrect because they either submit the steps directly to the experiment without creating a Pipeline object (Option A), or try to create a Run object directly from the steps without creating a Pipeline or Experiment object (Option B). Both of these approaches will result in errors. Option D correctly creates a Pipeline object and then submits the pipeline with the experiment name. However, please note that the submit method of the Pipeline class does not take an experiment_name argument. Instead, it takes an Experiment object. So, the correct code should be: pipeline = Pipeline(workspace=ws, steps=pipeline_steps) experiment = Experiment(workspace=ws, name='pipeline-experiment') run = pipeline.submit(experiment)
upvoted 1 times
...
james2033
1 year, 1 month ago
Selected Answer: CD
Constructor azurelm.pipeline.core.pipeline.Pipeline() https://learn.microsoft.com/en-us/python/api/azureml-pipeline-core/azureml.pipeline.core.pipeline.pipeline?view=azure-ml-py#constructor Pipeline(workspace, steps, ...)
upvoted 1 times
...
Tommo565
1 year, 8 months ago
Selected Answer: CD
CD is correct
upvoted 1 times
...
AzureJobsTillRetire
1 year, 9 months ago
Selected Answer: AC
The correct command for pipeline run is as below experiment.submit() Only A and C has this command. D has command pipeline.submit(), which is incorrect
upvoted 1 times
AzureJobsTillRetire
1 year, 9 months ago
An Azure Machine Learning experiment represent the collection of trials used to validate a user's hypothesis. In Azure Machine Learning, an experiment is represented by the Experiment class and a trial is represented by the Run class. An Azure Machine Learning pipeline is an independently executable workflow of a complete machine learning task. In an experiment, we execute a pipeline, and this is why we use experiment.submit(pipeline) It is not that in a pipeline, we execute an experiment, and that is why pipeline.submit(experiment) is wrong
upvoted 1 times
...
...
Arend78
1 year, 12 months ago
I also think it's A & C: In the Azure documentations, I have only found examples of run = experiment.submit(pipeline) and no examples of run = pipeline.submit(experiment_name='pipeline-experiment') Please reply if you don't agree
upvoted 1 times
AzureJobsTillRetire
1 year, 9 months ago
I think so too. Also there is no definition of the experiment 'pipeline-experiment' in the code
upvoted 1 times
...
...
zehraoneexam
2 years, 8 months ago
correct answer.
upvoted 2 times
...
Sjefen
2 years, 8 months ago
I think A & C as well
upvoted 1 times
...
synapse
2 years, 9 months ago
Selected Answer: CD
C and are correct. As per below. A is not correct because the submit() expects a Pipeline object. not a list. https://docs.microsoft.com/en-us/python/api/azureml-core/azureml.core.experiment.experiment?view=azure-ml-py#azureml-core-experiment-experiment-submit
upvoted 1 times
...
ranjsi01
2 years, 10 months ago
sorry i think it should be A and C
upvoted 2 times
...
ranjsi01
2 years, 10 months ago
correct
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 ...