Share via

azure machine learning SDK

ben wu 41 Reputation points
2022-05-31T22:12:29.473+00:00

How to import data not by passing it as an argument,
I do not want to do as the tutorial https://learn.microsoft.com/en-us/azure/machine-learning/how-to-train-with-datasets?source=docs

Azure Machine Learning
0 comments No comments

Answer accepted by question author

YutongTie-9091 54,026 Reputation points Moderator
2022-06-01T17:54:59.667+00:00

Hello @ben wu

Thanks for reaching out to us, there is the code sample from engineering team

from azureml.core import ScriptRunConfig  
  
input_data=titanic_ds.as_named_input('input_data').as_mount()  
src = ScriptRunConfig(source_directory=script_folder,  
                      script='train_titanic.py',  
                      compute_target=compute_target)  
src.run_config.data = {input_data.name: input_data }  
# Submit the run configuration for your training run  
run = experiment.submit(src)  
run.wait_for_completion(show_output=True)    

In your script, you can get the mounted path via environment variable, which is the value you specified in as_named_input. For the sample code above, the environment variable will be input_data.

I hopet this helps.

Regards,
Yutong

-Please kindly accept the answer if you feel helpful to support the community, thanks a lot.

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.