问题
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