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

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

Product
Teradata Vantage
Release Number
3.0
Published
May 2022
Last Update
2022-06-02
Content Type
User Guide
Publication ID
B700-1111-051K
Language
English (United States)

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')