Use the TDApiClient class to create training job objects of Vertex AI Python package.
This feature is implemented using getattr method of this class. Exact input for this method is determined by the class name of TrainingJob, such as CustomTrainingJob or AutoMLTabularTrainingJob.
Use the instance of TDApiClient only after acquiring necessary credentials from Google Cloud and creating TDApiContext.
Training Job Classes of Vertex AI
There are different training job classes of Vertex AI package that need to be used. For example:
- CustomTrainingJob: Useful for taking a training implementation as a python script
- CustomPythonPackageTrainingJob: Useful for taking a training implementation as a python package
- CustomContainerTrainingJob: Useful for training on a custom Docker container
- AutoMLTabularTrainingJob: Useful for training an AutoML model with tabular dataset
- AutoMLForecastingTrainingJob: Useful for training an AutoML model with time series dataset
Example
- Import necessary packages.
from tdapiclient import create_tdapi_context, TDApiClient from teradataml import DataFrame
- Create Google Cloud context to be used in all subsequent tdapiclient calls.
tdapi_context = create_tdapi_context('gcp', gcp_bucket_name="tdapiclient", gcp_bucket_path="/tmp/") tdapi_client = TDApiClient(tdapi_context)
- Create AutoML training job.
automl_job = tdapi_client.AutoMLTabularTrainingJob(optimization_prediction_type="classification", optimization_objective="maximize-au-roc")