DataPath 類別

表示資料存放區中資料的路徑。

DataPath 物件所代表的路徑可以指向目錄或資料成品, (blob、檔案) 。 DataPath 會與 類別搭配 DataPathComputeBinding 使用,其會定義管線步驟執行期間資料的取用方式。 使用 在管線提交 PipelineParameter 期間,可以在 修改 DataPath。

初始化 DataPath。

繼承
builtins.object
DataPath

建構函式

DataPath(datastore=None, path_on_datastore=None, name=None)

參數

datastore
Union[AbstractAzureStorageDatastore, AzureDataLakeDatastore]
預設值: None

[必要]要參考的資料存放區。

path_on_datastore
str
預設值: None

支援儲存體中的資料參考相對路徑。

name
str, <xref:optional>
預設值: None

DataPath 的選擇性名稱。

datastore
Union[AbstractAzureStorageDatastore, AzureDataLakeDatastore]
必要

[必要]要參考的資料存放區。

path_on_datastore
str
必要

支援儲存體中的資料參考相對路徑。

name
str, <xref:optional>
必要

DataPath 的選擇性名稱。

備註

下列範例示範如何使用 建立 DataPath,並使用 將引數傳入。 PipelineParameter


   def_blob_store = ws.get_default_datastore()
   print("Default datastore's name: {}".format(def_blob_store.name))

   data_path = DataPath(datastore=def_blob_store, path_on_datastore='sample_datapath1')
   datapath1_pipeline_param = PipelineParameter(name="input_datapath", default_value=data_path)
   datapath_input = (datapath1_pipeline_param, DataPathComputeBinding(mode='mount'))

   string_pipeline_param = PipelineParameter(name="input_string", default_value='sample_string1')

完整範例可從 https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-showcasing-datapath-and-pipelineparameter.ipynb

方法

create_data_reference

使用此 DataPath 和指定的 DataPathComputeBinding 建立 DataReference 物件。

create_from_data_reference

從 DataReference 建立 DataPath。

create_data_reference

使用此 DataPath 和指定的 DataPathComputeBinding 建立 DataReference 物件。

create_data_reference(data_reference_name=None, datapath_compute_binding=None)

參數

data_reference_name
str
預設值: None

要建立的資料參考名稱。

datapath_compute_binding
DataPathComputeBinding
預設值: None

[必要]用來建立資料參考的資料路徑計算系結。

傳回

DataReference 物件。

傳回類型

create_from_data_reference

從 DataReference 建立 DataPath。

static create_from_data_reference(data_reference)

參數

data_reference
DataReference
必要

[必要]用來建立資料路徑的資料參考。

傳回

DataPath 物件。

傳回類型

屬性

datastore_name

取得資料存放區的名稱。

傳回

名稱。

傳回類型

path_on_datastore

取得資料存放區上的路徑。

傳回

路徑。

傳回類型