TrainingJob.fit Method | Google Vertex AI teradataml Extension Library - TrainingJob.fit Method - 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
ft:locale
en-US
ft:lastEdition
2023-09-28
dita:mapPath
mgu1643999543506.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
mgu1643999543506
Use the TrainingJob.fit method to train a teradataml DataFrame with optional keyword arguments, and return a Google Vertex AI Model object.
You should have created TDApiClient class and created training job class with correct input (such as DataFrame, Script, Storage, and any other required details) before calling this fit method.
Required Argument:
  • df: Specifies the teradataml DataFrame to be used for training.
Optional Argument:
  • **vertex_kwargs: Keyword arguments supported by Vertex AI TrainingJob.run method.

Example

  • Import required packages.
    from tdapiclient import create_tdapi_context, TDApiClient
    from teradataml import DataFrame
  • Create TDApiClient class.
    tdapi_context = create_tdapi_context('gcp', gcp_bucket_name="tdapiclient", gcp_bucket_path="/tmp/")
    tdapi_client = TDApiClient(tdapi_context)
  • Create teradataml DataFrame for model training.
    input_df = DataFrame(table_name="inputTable")
  • Create AutoML training job with configuration specified by arguments.
    automl_job = tdapi_client.AutoMLTrainingJob(optimization_prediction_type="classification", optimization_objective="maximize-au-roc")
  • Submit training experiment.
    model = automl_job.fit(input_df)