【问题标题】:How to use Azure Data Lake Store as an input data set for Azure ML?如何使用 Azure Data Lake Store 作为 Azure ML 的输入数据集?
【发布时间】:2016-03-21 09:42:18
【问题描述】:

我正在将数据移动到 Azure Data Lake Store 并使用 Azure Data Lake Analytics 对其进行处理。数据是 XML 格式的,我正在通过XML Extractor 阅读它。现在我想从 Azure ML 访问这些数据,目前似乎不直接支持 Azure Data Lake 存储。

将 Azure Data Lake Store 与 Azure ML 结合使用的可能方式有哪些?

【问题讨论】:

    标签: azure-machine-learning-studio azure-data-lake


    【解决方案1】:

    正如您所指出的,目前,Azure Data Lake Store 不是受支持的源。也就是说,Azure Data Lake Analytics 也可用于将数据写入 Azure Blob Store,因此您可以将其用作在 U-SQL 中处理数据的一种方法,然后将其暂存以供 Azure 机器学习从 Blob 处理它店铺。当 Azure ML 支持 Data Lake 存储时,您可以切换它。

    【讨论】:

      【解决方案2】:
      
      account_name=os.getenv("ADLSGEN2_ACCOUNTNAME_62", "<storage account name>") # ADLS Gen2 account name
      tenant_id=os.getenv("ADLSGEN2_TENANT_62", "") # tenant id of service principal
      client_id=os.getenv("ADLSGEN2_CLIENTID_62", "") # client id of service principal
      client_secret=os.getenv("ADLSGEN2_CLIENT_SECRET_62", "") # the secret of service principal
      
      try:
          adlsgen2_datastore = Datastore.get(workspace, adlsgen2_datastore_name)
          print("Found ADLS Gen2 datastore with name: %s" % adlsgen2_datastore_name)
          datastore_paths = [(adlsgen2_datastore, 'path to data.csv')]
          dataset = Dataset.Tabular.from_delimited_files(path=datastore_paths)
          df = dataset.to_pandas_dataframe()
          display(dataset.to_pandas_dataframe())
          datastore = adlsgen2_datastore
          dataset = Dataset.Tabular.register_pandas_dataframe(df, datastore, "<DataSetStep>", show_progress=True)
      
      except:
          adlsgen2_datastore = Datastore.register_azure_data_lake_gen2(
              workspace=workspace,
              datastore_name=adlsgen2_datastore_name,
              filesystem='fs', # Name of ADLS Gen2 filesystem
              account_name=account_name, # ADLS Gen2 account name
              tenant_id=tenant_id, # tenant id of service principal
              client_id=client_id, # client id of service principal
              client_secret=client_secret) # the secret of service principal
      
      

      参考:https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-data-transfer.ipynb

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-10-09
        • 1970-01-01
        • 1970-01-01
        • 2021-06-22
        • 2019-10-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多