nerdexam
MicrosoftMicrosoft

DP-100 · Question #137

DP-100 Question #137: Real Exam Question with Answer & Explanation

The correct answer is B: script_params = { '--data-folder': data_ref.as_mount() } estimator = SKLearn(source_directory='./script', script_params=script_params, compute_target='local', entry_script='train.py'). Besides passing the dataset through the inputs parameter in the estimator, you can also pass the dataset through script_params and get the data path (mounting point) in your training script via arguments. This way, you can keep your training script independent of azureml-sdk. In

Explore data and run experiments

Question

You create a datastore named training_data that references a blob container in an Azure Storage account. The blob container contains a folder named csv_files in which multiple comma- separated values (CSV) files are stored. You have a script named train.py in a local folder named ./script that you plan to run as an experiment using an estimator. The script includes the following code to read data from the csv_files folder: You have the following script. You need to configure the estimator for the experiment so that the script can read the data from a data reference named data_ref that references the csv_files folder in the training_data datastore. Which code should you use to configure the estimator? A. B. C. D. E.

Options

  • Aestimator = SKLearn(source_directory='./script', inputs=[data_ref.as_named_input('data-folder').to_pandas_dataframe()], compute_target='local', script_params={}, entry_script='train.py')
  • Bscript_params = { '--data-folder': data_ref.as_mount() } estimator = SKLearn(source_directory='./script', script_params=script_params, compute_target='local', entry_script='train.py')
  • Cestimator = SKLearn(source_directory='./script', inputs=[data_ref.as_named_input('data-folder').as_mount()], compute_target='local', entry_script='train.py')
  • Dscript_params = { '--data-folder': data_ref.as_download(path_on_compute='csv_files') } estimator = SKLearn(source_directory='./script', script_params=script_params, compute_target='local', entry_script='train.py')
  • Eestimator = SKLearn(source_directory='./script', inputs=[data_ref.as_named_input('data-folder').as_download(path_on_compute='csv_files')], compute_target='local', entry_script='train.py')

Explanation

Besides passing the dataset through the inputs parameter in the estimator, you can also pass the dataset through script_params and get the data path (mounting point) in your training script via arguments. This way, you can keep your training script independent of azureml-sdk. In other words, you will be able use the same training script for local debugging and remote training on any cloud platform. from azureml.train.sklearn import SKLearn script_params = { # mount the dataset on the remote compute and pass the mounted path as an argument to the '--data-folder': mnist_ds.as_named_input('mnist').as_mount(), '--regularization': 0.5 est = SKLearn(source_directory=script_folder, script_params=script_params, compute_target=compute_target, environment_definition=env, entry_script='train_mnist.py') # Run the experiment run = experiment.submit(est) run.wait_for_completion(show_output=True) Incorrect Answers: A: Pandas DataFrame not used. https://docs.microsoft.com/es-es/azure/machine-learning/how-to-train-with-datasets

Topics

#Azure Machine Learning#Datastores#DataReference#Estimator

Community Discussion

No community discussion yet for this question.

Full DP-100 PracticeBrowse All DP-100 Questions