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)