MOJO Example with EnableOptions | Vantage BYOM - H2OPredict Example: ModelOutputFields - 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
Language
English (United States)
Last Update
2024-04-06
dita:mapPath
fee1607120608274.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
fee1607120608274
select * from mldb.H2OPredict(
    on (select * FROM winestrain sample 5)
    on (select * from mojo_models where model_id = 'bin_wine_mojo_gbm') DIMENSION
    using
        Accumulate('wine_id')
        ModelOutputFields('label','classProbabilities','contributions','leafnodeassignments','stageprobabilities')
        EnableOptions('leafnodeassignments','stageprobabilities','contributions')
) as td;
 
 *** Query completed. 5 rows found. 7 columns returned.
 *** Total elapsed time was 1 second.
The following example is a snippet of the total output:
wine_id prediction	label	classprobabilities	contributions	leafnodeassignments
-------------------  -----------  --------------------  -----------------  ------------------------
	5926 0         0	{"0": 0.9968420757426275,"1": 0.0031579242573724358}	{"fixed_acidity": -0.013056158,"volatile_acidity": -0.13548231,"citric_acid": 0.0013693329,"residual_sugar": 0.0076238196,"chlorides": -0.83561426,"free_sulfur_dioxide": 0.050528985,"total_sulfur_dioxide": -1.1812251,"density": -0.41103098,"pH": -0.08305049,"sulphates": -0.16572128,"alcohol": -0.02420906,"quality": -3.8396614E-4}	[RLLLL, RLLLL, RLLLL, RLLRR, RLLLL, RLRLR, RLLLL, RLLLR, RLRLL, RLLLR, RLRLL, LRLLL, RLLLR, RLLLR, LRLLL, RLLRL, RLLLR, RLLLL, RLLRL, LRLLL, RLLRL, RLLRL, LRRLR, RLLRL, LRLLL, LRRRR, LRLLL, RLRRL, LRLLR, LRRLR, RLRRL, RLLRL, LRLLL, LRLRL, RLRLL, RLLLR, LRRRL, RLRLL, LRLLL, RLRRR, RLRLR, RLLLR, RLRLR, LLLLR, RLRLL, LLLRR, RRLLR, LLRRR, LLLLR, RLRLR]
       4137 0       0	{"0": 0.9967583588168474,"1": 0.0032416411831526076}	{"fixed_acidity": -0.05196306,"volatile_acidity": -0.2888404,"citric_acid": -0.0043992857,"residual_sugar": -0.2530282,"chlorides": 0.6672683,"free_sulfur_dioxide": -0.015595852,"total_sulfur_dioxide": -2.6713772,"density": 0.07745419,"pH": -0.12731172,"sulphates": 0.023299774,"alcohol": -0.14568566,"quality": 0.026176445}	[RLLLL, RLLLL, RLLLL, RLLRR, RLLLL, RLRLR, RLLLL, RLLRL, RLRLR, RLLLR, RLRLL, RRLLL, RLLLR, RLLLR, RRLLL, RLLRL, RLLLR, RLLLL, RLLRL, RRLLL, RLLRL, RLLRL, RRLLL, RLLRL, RRLLL, RRLRL, RRLLL, RLRRL, RRLLR, RRLLL, RLRRL, RLLRL, RRRLL, RRRLL, RLRLL, RLLLR, LRRRL, RLRLL, RLLLR, RLRRR, RLRLR, RLLLR, RLRLR, RRRLR, RLRLL, RRLRR, RRLLR, RLRLL, RLLLL, RLRLR]
...

See Python Code to Generate H2O Open Source Models for the Python codes needed to generate the models.