
Answer-first summary for fast verification
Answer: No
The solution does NOT meet the goal because it incorrectly attempts to set conda_dependencies to a string 'scikit-learn' instead of using proper Azure ML environment configuration methods. The correct approach would be to either: 1) Use an Environment object with conda dependencies specified, 2) Use the deprecated Estimator class with conda_packages parameter (as shown in the community discussion), or 3) Use ScriptRunConfig with a properly configured Environment. The community discussion confirms this with 100% consensus on answer B (No), noting that the Estimator approach requires conda_packages=['scikit-learn'] parameter. Additionally, comments mention that the Estimator class is deprecated and ScriptRunConfig should be used instead, but the provided ScriptRunConfig implementation is incorrect.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You have a Python script named train.py in a local folder named scripts. The script trains a regression model using scikit-learn and includes code to load a training data file from the same 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 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:
from azureml.core import ScriptRunConfig, Experiment
src = ScriptRunConfig(source_directory='scripts',
script='train.py',
compute_target=aml_compute)
run_config = src.run_config
run_config.environment.python.conda_dependencies = 'scikit-learn'
experiment = Experiment(workspace=ws, name='train-experiment')
run = experiment.submit(config=src)
from azureml.core import ScriptRunConfig, Experiment
src = ScriptRunConfig(source_directory='scripts',
script='train.py',
compute_target=aml_compute)
run_config = src.run_config
run_config.environment.python.conda_dependencies = 'scikit-learn'
experiment = Experiment(workspace=ws, name='train-experiment')
run = experiment.submit(config=src)
Does the solution meet the goal?

A
Yes
B
No
No comments yet.