
Answer-first summary for fast verification
Answer: arguments = ['--input-data', ds.as_mount()]
The correct answer is B because the question specifies that the dataset consists of multiple large image files that must be streamed directly from its source. The as_mount() method is designed for streaming scenarios where data should be accessed directly from the storage source without downloading it to the compute target, which is optimal for large files like images. Option A (to_pandas_dataframe()) is unsuitable as it converts the dataset to a tabular format, which doesn't apply to image files and would require downloading the data. Option C uses an incorrect argument format ('--data-data' instead of '--input-data') and passes the dataset object directly without a streaming method. Option D (as_download()) downloads the data to the compute target, which contradicts the requirement to stream directly from the source and is inefficient for large files. The community discussion strongly supports B, with upvoted comments emphasizing that as_mount() enables streaming for large datasets and aligns with the requirement to access data directly from its source.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You plan to run a Python script as an Azure Machine Learning experiment. The script contains the following code:
from azureml.core import Dataset, Run
run = Run.get_context()
ds = run.input_datasets['images']
# Additional script logic to process the dataset
from azureml.core import Dataset, Run
run = Run.get_context()
ds = run.input_datasets['images']
# Additional script logic to process the dataset
You must specify a file dataset as an input to the script. The dataset consists of multiple large image files and must be streamed directly from its source.
You need to write code to define a ScriptRunConfig object for the experiment and pass the ds dataset as an argument.
Which code segment should you use?

A
arguments = ['--input-data', ds.to_pandas_dataframe()]
B
arguments = ['--input-data', ds.as_mount()]
C
arguments = ['--data-data', ds]
D
arguments = ['--input-data', ds.as_download()]
No comments yet.