fit() Method | teradataml Azure Extension Library |API Integration - fit() Method - Training Azure Machine Learning Model - Teradata Vantage

Teradata Vantageā„¢ - API Integration Guide for Cloud Machine Learning

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Vantage
Release Number
1.4
Published
September 2023
Language
English (United States)
Last Update
2023-09-28
dita:mapPath
mgu1643999543506.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
mgu1643999543506

Use the fit() method to run Azure Machine Learning training API with teradataml DataFrame as input.

The fit method copies the data to Azure Blob Storage and then invokes any of the Azure Machine Learning Python API's callable through tdapiclient, as listed in teradataml Extension.

In more details, the fit() method belongs to <RunConfig> object obtained by invoking tdapiclient.<RunConfig>. This method exports teradataml DataFrame object present in RunConfig's parameters to Azure Machine Learning datastore, wraps it in dataset, and then creates Azure Machine Learning Experiment based on RunConfig's parameter and submits it to workspace.

Optional Arguments:
  • content_type: Specifies content type for inputs.

    Supported formats for Azure Machine Learning dataset object are 'parquet' (default value), 'csv'.

  • mount: Specifies whether input teradataml DataFrame is to be exported as mount point or just plain Azure Machine Learning dataset. The default value is 'True'.
  • wait: Specifies whether the function will wait for experiment to finish. The default value is 'True'.

Examples

  • Import necessary packages.
    from tdapiclient import create_tdapi_context, TDApiClient
  • Create the TDAPI context.
    context = create_tdapi_context("azure", "/td-tables")
  • Create TDApiClient object.
    tdapiclient = TDApiClient(context)
  • Create a SKLearn model.

    ScriptRunConfig takes all the parameters as required by Azure Machine Learning ScriptRunConfig.

    skLearnObject = tdapiclient.ScriptRunConfig()
  • Create Azure Machine Learning RunConfig class using the TDApiClient object.
    tdapiclient.ScriptRunConfig(List of parameters required by Azure Machine Learning ScriptRunConfig class)
  • Run the Azure Machine Learning training API with teradataml DataFrame as mount point.
    skLearnObject.fit(mount=True)