
Answer-first summary for fast verification
Answer: run = script_experiment.submit(config=script_config)
Option D is correct because the `submit()` method of the Experiment class is used to start an experiment run with a specified configuration. In this case, `script_experiment.submit(config=script_config)` submits the experiment using the ScriptRunConfig object (`script_config`), which defines the script to run and executes it on the local computer with the default environment, as required. Option A (`start_logging()`) is for interactive logging in notebooks, not for submitting script runs. Option B (`Run(experiment=script_experiment)`) incorrectly initializes a Run object without starting the experiment. Option C (`ws.get_run(run_id=experiment.id)`) retrieves an existing run by ID but does not start a new one. The community discussion, with 100% consensus and upvoted comments, confirms D as the correct choice, emphasizing that 'submit' is the keyword for initiating runs.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You have the following code that prepares an experiment to run a script:
from azureml.core import Experiment
experiment = Experiment(workspace=ws, name='my_experiment')
from azureml.core import Experiment
experiment = Experiment(workspace=ws, name='my_experiment')
The experiment must be run on your local computer using the default environment. You need to add code to start the experiment and run the script. Which code segment should you use?

A
run = script_experiment.start_logging()
B
run = Run(experiment=script_experiment)
C
ws.get_run(run_id=experiment.id)
D
run = script_experiment.submit(config=script_config)
No comments yet.