
Microsoft Certified Azure Data Scientist Associate - DP-100
Get started today
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)
src.run_config.framework = 'scikit-learn'
experiment = Experiment(workspace=ws, name='train-experiment')
run = experiment.submit(src)
Does the solution meet the goal?
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)
src.run_config.framework = 'scikit-learn'
experiment = Experiment(workspace=ws, name='train-experiment')
run = experiment.submit(src)
Does the solution meet the goal?
Exam-Like
