ONNXPredict Example with ShowModelInputFieldsMap | Vantage BYOM - ONNXPredict Example: With ShowModelInputFieldsMap - Teradata Vantage

Teradata Vantageā„¢ - Bring Your Own Model User Guide

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
Lake
VMware
Product
Teradata Vantage
Release Number
5.0
Published
October 2023
ft:locale
en-US
ft:lastEdition
2024-04-06
dita:mapPath
fee1607120608274.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
fee1607120608274

When using ShowModelInputFieldsMap along with a given ModelInputFieldsMap argument, column names are copied to the output. However, column ranges are expanded from their numeric range to the actual column name that the range index specifies. This helps list out all columns and allows you to make sure that the order matches what your model input expects.

select TOP 1 * from mldb.ONNXPredict(
    on (select * from iris_test)  --- Columns order is not important
    on (select * from onnx_models where model_id='tf_iris_softmax_onetensor_model') DIMENSION
    using 
      Accumulate('id')
        ModelInputFieldsMap('float_input=[1:4]') -- this could also be 'x=sepal_length:petal_width' and would have the same result
        ShowModelInputFieldsMap('true') 
) as td
;
 
 *** Query completed. 1 row found. 3 columns returned.
 *** Total elapsed time was 1 second.
ModelInputFieldsMap 
------------------------------------------------------------------------------------------------------------
        ModelInputFieldsMap('x=sepal_length,sepal_width,petal_length,petal_width')