The TDApiClient.deploy method deploys Amazon SageMaker model to Vantage or AWS.
- If the platform is Vantage, model is saved in Teradata database using BYOM functionality.
- If the platform is AWS, SageMaker.deploy method of Amazon SageMaker estimator class is executed, allowing integration with Teradata at the time of scoring.
This function returns an instance of TDSagemakerPredictor or BYOMPredictor.
- platform: Specifies the platform to which the given model will be deployed.
Accepted values: "vantage", "aws-endpoint".
- sagemaker_p_args: Specifies all positional parameters required for the original SageMaker.deploy method.
- sagemaker_kw_args: Specifies all kwarg parameters required for the original SageMaker.deploy method.
- model_type: Specifies the type of the model. Required when platform is "vantage".
Accepted values: "pmml", "onnx", "h2o".
- model_s3_key: Specifies the S3 key of model to deploy in Vantage. Required when platform is "vantage".
- model_id: Specifies the id of the model for Teradata table.
If no value is given, the id of the given Amazon SageMaker model is used.
- save_byom_kwargs: Specifies the keyword arguments for teradataml save_byom() function.
If neither the table_name is provided nor the BYOM catalog information is set using set_byom_catalog(), a table with the name 'tdapiclient_byom_models' will be created in the current schema to save the model.
- retrieve_byom_kwargs: Specifies the keyword arguments for teradataml retrieve_byom() function.
Example 1: Deploy to Vantage
Assuming ´sklearn_model´ is a TDApiClient object holding a model which has been trained on AWS, this example shows how to deploy it to Vantage.
´predictor1´ is of type TDSagemakerPredictor.
predictor1 = sklearn_model.deploy( platform="vantage", model_type="onnx", model_s3_key="sklearn/model.onnx" )
Example 2: Deploy to AWS
Assuming ´xgboost_estimator´ is a TDApiClient object holding a model which has been trained on AWS, this example shows how to deploy it to an AWS endpoint.
´predictor2´ is of type BYOMPredictor.
predictor2 = xgboost_estimator.deploy( platform="aws-endpoint" sagemaker_kw_args={"instance_type": "ml.m5.large", "initial_instance_count": 1} )