API_Request In-database Function Usage | Amazon Forecast | Teradata Vantage - API_Request In-database Function Usage - 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

Usage Considerations

Before using API_Request in-database function with Amazon Forecast, you should deploy your trained model using Amazon Forecast and get the endpoint information.

You should also have credentials which have permissions on Amazon SageMaker to use this in-database function.

Usage Example

SELECT Timestamp, Predictionvalue
FROM tapidb.API_Request(
    ON (SELECT fkey_1, fvalue_1 FROM forecast_input_tbl)
    USING
    AUTHORIZATION('{"Access_ID":"your_access_id",
                     "Access_Key":"your_access_key",
                     "Region":"aws_region",
                     "SESSION_TOKEN":"session_token"}')
    API_TYPE('aws-forecast')
    ENDPOINT('arn:aws:forecast:us-west-2:076:forecast/demo_deep_ar_plus')
) as "DT"
;

API_Request query result:

Timestamp            PredictionValue
------------------- ----------------------
2022-04-01T00:00:00  5.20171852112000E 001
2022-04-01T01:00:00  5.10696907043000E 001
2022-04-01T02:00:00  5.02745094299000E 001
2022-04-01T03:00:00  4.43840866089000E 001
2022-04-01T04:00:00  4.46497497559000E 001
2022-04-01T05:00:00  4.81300239563000E 001
2022-04-01T06:00:00  4.94036216736000E 001
2022-04-01T07:00:00  5.24066925049000E 001
2022-04-01T08:00:00  5.77213211060000E 001
2022-04-01T09:00:00  8.73532180786000E 001
.......