XGBoost Example: Regression, Dense Format | Teradata Vantage - XGBoostPredict Example: Regression, Dense Format - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
9.02
9.01
2.0
1.3
Published
February 2022
Language
English (United States)
Last Update
2022-02-10
dita:mapPath
rnn1580259159235.ditamap
dita:ditavalPath
ybt1582220416951.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantageā„¢

Input

InputTable: boston

id  crim zn  indus chas nox rm age  dis rad tax  ptratio black lstat medv
--- ---- --- ----- ---- --- -- ---- --- --- ---- ------- ----- ----- ----
399  38.  0.   18.   0.  1. 5. 100.  1. 24. 666.      20. 397.   31.   5.
406  68.  0.   18.   0.  1. 6. 100.  1. 24. 666.      20. 385.   23.   5.
401  25.  0.   18.   0.  1. 6. 100.  2. 24. 666.      20. 397.   27.   6.
400  10.  0.   18.   0.  1. 6.  78.  2. 24. 666.      20. 338.   30.   6.
416  18.  0.   18.   0.  1. 6. 100.  2. 24. 666.      20.  27.   29.   7.
386  17.  0.   18.   0.  1. 5.  98.  1. 24. 666.      20. 397.   31.   7.
490   0.  0.   28.   0.  1. 5.  98.  2.  4. 711.      20. 344.   24.   7.
415  46.  0.   18.   0.  1. 5. 100.  2. 24. 666.      20.  88.   37.   7.
388  23.  0.   18.   0.  1. 5.  90.  2. 24. 666.      20. 397.   32.   7.
402  14.  0.   18.   0.  1. 6. 100.  2. 24. 666.      20. 397.   20.   7.
491   0.  0.   28.   0.  1. 5.  98.  2.  4. 711.      20. 318.   30.   8.
439  14.  0.   18.   0.  1. 6.  88.  2. 24. 666.      20.  69.   34.   8.
426  16.  0.   18.   0.  1. 6.  95.  2. 24. 666.      20.   8.   24.   8.
404  25.  0.   18.   0.  1. 5.  96.  2. 24. 666.      20. 397.   20.   8.
398   8.  0.   18.   0.  1. 6.  99.  2. 24. 666.      20. 393.   20.   8.
420  12.  0.   18.   0.  1. 7.  76.  2. 24. 666.      20.  48.   23.   8.

SQL Call

CREATE MULTISET TABLE boston_predict AS (
  SELECT * FROM XGBoostPredict (
    ON boston AS InputTable PARTITION BY ANY
    ON xgboost_regression_model AS MODEL DIMENSION ORDER BY tree_id, iter, class_num
    USING
    IDColumn ('id')
    Accumulate ('medv')
    NumBoostedTrees ('1')
  ) AS dt
) WITH DATA;

Output

id  medv prediction         confidence_lower       confidence_upper
--- ---- ------------------ ---------------------- ---------------------
469   19 18.850557688833007  1.16142058584330E 001 2.60869095192330E 001
265   36 36.00875312883301   9.61504189683301E 000 6.24024643608330E 001
 40   31 32.254564321464585  1.32190631519067E 001 5.12900654910225E 001
122   20 19.77229760288706   1.43425560040330E 001 2.52020392017411E 001
 61   19 21.13847502392224   1.83864411702971E 001 2.38905088775473E 001
244   24 23.894667448833008  2.12445641496330E 001 2.65447707480330E 001
162   50 50.003928928833005 -3.82032687116698E 000 1.03828184728833E 002
387   10 10.997804435083008 -1.16299437726670E 001 3.36255526428330E 001
326   25 25.27121734883301   1.99230762456330E 001 3.06193584520330E 001
305   36 36.01755632883301   9.60659082483301E 000 6.24285218328330E 001
223   28 27.746776557404438  1.75465394054044E 001 3.79470137094044E 001
448   13 14.707177191690151 -6.50200413109847E-001 3.00645547964901E 001
183   38 38.014925728833006  7.68911620083300E 000 6.83407352568330E 001
101   28 28.369752234547292  1.69484827553473E 001 3.97910217137473E 001
488   21 22.184685479914588  2.14832241200345E 001 2.28861468397947E 001
 19   20 18.548153496525316  1.07190894492022E 001 2.63772175438484E 001
366   28 28.060509068833007  1.72453561944330E 001 3.88756619432330E 001
427   10 9.990482428833008  -1.46116169111670E 001 3.45925817688330E 001
 80   20 21.131775193464588  1.83666096721425E 001 2.38969407147867E 001
263   49 49.00818912883301  -2.86441666316699E 000 1.00880794920833E 002
...