nerdexam
Microsoft

DP-100 · Question #245

You plan to run a Python script as an Azure Machine Learning experiment. The script contains the following code: You must specify a file dataset as an input to the script. The dataset consists of…

The correct answer is A. arguments = ['--input-data', ds.to_pandas_dataframe()]. Note: The listed answer A (to_pandas_dataframe()) is incorrect for this scenario. For a FileDataset of large image files that must be streamed directly from the source without copying to local disk, as_mount() is the correct mode. It exposes the datastore as a virtual…

Explore data and run experiments

Question

You plan to run a Python script as an Azure Machine Learning experiment. The script contains the following code: 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?

Exhibit

DP-100 question #245 exhibit

Options

  • Aarguments = ['--input-data', ds.to_pandas_dataframe()]
  • Barguments = ['--input-data', ds.as_mount()]
  • Carguments = ['--data-data', ds]
  • Darguments = ['--input-data', ds.as_download()]

How the community answered

(50 responses)
  • A
    78% (39)
  • B
    14% (7)
  • C
    6% (3)
  • D
    2% (1)

Explanation

Note: The listed answer A (to_pandas_dataframe()) is incorrect for this scenario. For a FileDataset of large image files that must be streamed directly from the source without copying to local disk, as_mount() is the correct mode. It exposes the datastore as a virtual filesystem so files are read on-demand, avoiding the overhead of downloading all images before the script starts. as_download() would copy all files to the compute node first-the opposite of streaming from source. to_pandas_dataframe() is only valid for TabularDatasets and cannot represent image files. The requirement to 'stream directly from its source' is the defining clue that points to as_mount().

Topics

#Azure Machine Learning Experiments#ScriptRunConfig#Dataset Input#Data Input Methods

Community Discussion

No community discussion yet for this question.

Full DP-100 Practice