
Answer-first summary for fast verification
Answer: best_model = automl_run.get_output()[1]
The correct answer is D because the `get_output()` method of an AutoMLRun object returns a tuple containing the best run and the fitted model. According to the Azure ML documentation and the community consensus (with the highest upvoted comments supporting D), `automl_run.get_output()[1]` retrieves the fitted model, which is what the question asks for. Option A (`get_details()`) returns metadata about the run, not the model. Option B (`get_metrics()`) returns performance metrics, not the model object. Option C (`get_file_names()[1]`) retrieves file names from the run, which is unrelated to obtaining the best model. The community discussion strongly favors D, with multiple comments citing official documentation and practical usage examples.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You run an experiment that uses an AutoMLConfig class to define an automated machine learning task with a maximum of ten model training iterations. The task will attempt to find the best performing model based on a metric named accuracy.
You submit the experiment with the following code:
experiment = Experiment(workspace=ws, name='automl-experiment')
config = AutoMLConfig(task='classification',
primary_metric='accuracy',
max_trials=10,
**other_arguments)
run = experiment.submit(config)
experiment = Experiment(workspace=ws, name='automl-experiment')
config = AutoMLConfig(task='classification',
primary_metric='accuracy',
max_trials=10,
**other_arguments)
run = experiment.submit(config)
You need to create Python code that returns the best model that is generated by the automated machine learning task.
Which code segment should you use?

A
best_model = automl_run.get_details()
B
best_model = automl_run.get_metrics()
C
best_model = automl_run.get_file_names()[1]
D
best_model = automl_run.get_output()[1]
No comments yet.