1.0 - 8.00 - XGBoostPredict Example 1: Binary Classification - Teradata Vantage

Teradata® Vantage Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
1.0
8.00
Release Date
May 2019
Content Type
Programming Reference
Publication ID
B700-4003-098K
Language
English (United States)

Input

input: housing_test_binary
sn price lotsize bedrooms bathrms stories driveway recroom fullbase gashw airco garagepl prefarea homestyle
13 27000 1700 3 1 2 yes no no no no 0 no Classic
16 37900 3185 2 1 1 yes no no no yes 0 no Classic
540 85000 7320 4 2 2 yes no no no no 0 no Eclectic
... ... ... ... ... ... ... ... ... ... ... ... ... ...

SQL Call

CREATE MULTISET TABLE housing_predict AS (
  SELECT * FROM XGBoostPredict (
    ON housing_test_binary AS "input" PARTITION BY ANY
    ON xgboost_model AS modeltable DIMENSION ORDER BY tree_id, iter, class_num
    USING
    IDColumn ('sn')
    NumBoostedTrees (1)
    Accumulate ('homestyle')
  ) AS dt
) WITH DATA;
 

Output

housing_predict
sn homestyle prediction confidence_lower confidence_upper
16 Classic Classic 1 1
38 Eclectic Eclectic 1 1
132 Classic Classic 1 1
140 Classic Classic 1 1
142 Classic Classic 1 1
176 Eclectic Eclectic 1 1
198 Classic Classic 1 1
224 Eclectic Eclectic 1 1
234 Classic Classic 1 1
254 Eclectic Eclectic 1 1
... ... ... ... ...