Create a FileDataset from local file

PHOTO EMBED

Fri Apr 08 2022 22:52:09 GMT+0000 (Coordinated Universal Time)

Saved by @wessim

from azureml.core import Workspace, Datastore, Dataset
from azureml.data.datapath import DataPath

ws = Workspace.from_config()
datastore = Datastore.get(ws, '<name of your datastore>')
ds = Dataset.File.upload_directory(src_dir='<path to you data>',
           target=DataPath(datastore,  '<path on the datastore>'),
           show_progress=True)
content_copyCOPY

A FileDataset references single or multiple files in your datastores or public URLs. If your data is already cleansed, and ready to use in training experiments, you can download or mount the files to your compute as a FileDataset object. We recommend FileDatasets for your machine learning workflows, since the source files can be in any format, which enables a wider range of machine learning scenarios, including deep learning. Create a FileDataset with the Python SDK or the Azure Machine Learning studio . If your storage is behind a virtual network or firewall, set the parameter validate=False in your from_files() method. This bypasses the initial validation step, and ensures that you can create your dataset from these secure files.

https://docs.microsoft.com/en-us/azure/machine-learning/how-to-create-register-datasets