TDApiClient .fit Method | teradataml AWS Extension Library |API Integration - TDApiClient.fit Method - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

This wrapper function execute the SageMaker.fit method of Amazon SageMaker using the teradataml DataFrame as source for training.

The fit method copies the data to S3 and then invokes any of the AWS Python API's callable through tdapiclient, as listed in teradataml Extension.

Required Argument:
  • inputs: Specifies a teradataml DataFrame or S3 path as a string.
    It can be one of the following:
    • Single object of teradataml DataFrame
    • String
    • Dictionary of string to object of teradataml DataFrame
Optional Arguments:
  • content_type: Specifies the content type for inputs.

    Default value is CSV.

  • convert_at_local_node: Specifies whether to automatically download Parquet data from S3, convert it to JSON at client, and upload the result to S3.

    This setting is ignored when content_type is not JSON.

    The Default Value is False.

  • **sg_kw_args: Specifies any additional argument required for SageMaker.fit. These parameters are directly supplied to SageMaker.fit method.

Example

from tdapiclient import create_tdapi_context, TDApiClient
context = create_tdapi_context("aws", "s3_bucket")
tdapiclient = TDApiClient(context)
# SKlearn takes all parameters that AWS SageMaker Library requires
skLearnObject = tdapiclient.SKLearn()
train = DataFrame(tableName='train_data')
test = DataFrame(tableName='test_data')
skLearnObject.fit(inputs={'train': train, 'test': test},
                        content_type='csv', wait=False)