Is it possible to load the Dataset to Microsoft Azure Machine Learning Studio programmatically?

泄露秘密 提交于 2020-03-23 12:04:17

问题


I'm working in a .NET project where I will generate a dataset. I need to load that dataset into Azure Machine Learning Studio. Is there a way to load that dataset into ML studio programmatically (perhaps with an apikey and RequestURI) instead of manually loading dataset in the Azure ML Studio?


回答1:


It may help you:

local_path = 'data/prepared.csv'
dataframe.to_csv(local_path)
upload the local file to a datastore on the cloud
# azureml-core of version 1.0.72 or higher is required
# azureml-dataprep[pandas] of version 1.1.34 or higher is required
from azureml.core import Workspace, Dataset

subscription_id = 'xxxxxxxxxxxxxxxxxxxxx'
resource_group = 'xxxxxx'
workspace_name = 'xxxxxxxxxxxxxxxx'

workspace = Workspace(subscription_id, resource_group, workspace_name)

# get the datastore to upload prepared data
datastore = workspace.get_default_datastore()

# upload the local file from src_dir to the target_path in datastore
datastore.upload(src_dir='data', target_path='data')
# create a dataset referencing the cloud location
dataset = Dataset.Tabular.from_delimited_files(datastore.path('data/prepared.csv'))

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

There is also Workspace class for C# https://docs.microsoft.com/en-us/python/api/azureml-core/azureml.core.workspace.workspace?view=azure-ml-py




回答2:


I'm not sure of a way to do this with C#, but there is an Azure ML extension to the Azure CLI that allows you to register a Dataset.

If that's not sufficient, then the Python SDK is definitely the way to go. Check out this answer for more info on that front.



来源:https://stackoverflow.com/questions/60632493/is-it-possible-to-load-the-dataset-to-microsoft-azure-machine-learning-studio-pr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!