nerdexam
Microsoft

DP-100 · Question #243

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…

The correct answer is C. pipeline = Pipeline(workspace=ws, steps=pipeline_steps) D. pipeline = Pipeline(workspace=ws, steps=pipeline_steps). Both C and D show the same first line: pipeline = Pipeline(workspace=ws, steps=pipeline_steps). This creates a Pipeline object from the defined steps. The two valid approaches to then submit and run it are: (C) using experiment.submit(pipeline) - where an Experiment object is…

Explore data and run experiments

Question

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.

Options

  • Aexperiment = Experiment(workspace=ws,
  • Brun = Run(pipeline_steps)
  • Cpipeline = Pipeline(workspace=ws, steps=pipeline_steps)
  • Dpipeline = Pipeline(workspace=ws, steps=pipeline_steps)

How the community answered

(58 responses)
  • A
    7% (4)
  • B
    3% (2)
  • C
    90% (52)

Explanation

Both C and D show the same first line: pipeline = Pipeline(workspace=ws, steps=pipeline_steps). This creates a Pipeline object from the defined steps. The two valid approaches to then submit and run it are: (C) using experiment.submit(pipeline) - where an Experiment object is created and the pipeline is submitted to it, returning a PipelineRun; and (D) using pipeline.submit(experiment_name='...') - directly calling submit on the Pipeline object with an experiment name. Option B (run = Run(pipeline_steps)) is invalid because the Run class constructor does not accept pipeline steps. Option A is incomplete as shown. Both C and D represent correct end-to-end patterns for executing an Azure ML pipeline.

Topics

#Azure ML Pipelines#Pipeline definition#PythonScriptStep

Community Discussion

No community discussion yet for this question.

Full DP-100 Practice