1.1 - 8.10 - AdaBoostPredict Example: OutputProb, Responses - Teradata Vantage

Teradata Vantage™ - Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
1.1
8.10
Release Date
October 2019
Content Type
Programming Reference
Publication ID
B700-4003-079K
Language
English (United States)

Input

Input tables are from DecisionTree Example: Create Model:
  • AttributeTable: iris_attribute_test
  • Model: iris_attribute_output_prob

SQL Call

CREATE MULTISET TABLE adaboost_predict AS (
  SELECT * FROM AdaBoostPredict (
  ON iris_attribute_test AS AttributeTable PARTITION BY pid
  ON iris_attribute_output_ab AS Model DIMENSION ORDER BY classifier_id, node_id
  USING
  AttrTableGroupbyColumns ('attribute')
  AttrTablePidColumns ('pid')
  AttrTableValColumn ('attrvalue')
  OutputProb ('true')
  Responses('1','2','3')
  ) AS dt 
) WITH DATA;

Output

SELECT * FROM adaboost_predict ORDER BY pid;
 pid pred_label prob_for_label_1 prob_for_label_2 prob_for_label_3 
 --- ---------- ---------------- ---------------- ---------------- 
   5 1                   0.99621          0.00379                0
  10 1                   0.99621          0.00379                0
  15 1                         1                0                0
  20 1                   0.99621          0.00379                0
  25 1                   0.97673          0.02327                0
  30 1                   0.99621          0.00379                0
  35 1                   0.99621          0.00379                0
  40 1                   0.99621          0.00379                0
  45 1                   0.97673          0.02327                0
  50 1                   0.99621          0.00379                0
  55 2                   0.00714          0.95673          0.03613
  60 2                   0.01871          0.94384          0.03745
  65 2                   0.00714          0.95673          0.03613
  70 2                   0.00702          0.95747          0.03551
  75 2                   0.00681          0.95876          0.03443
  80 2                   0.00702          0.95747          0.03551
  85 3                         0          0.06343          0.93657
  90 2                   0.01897          0.94711          0.03392
  95 2                   0.00681          0.95876          0.03443
 100 2                   0.00681          0.95876          0.03443
 105 3                         0          0.09791          0.90209
 110 3                         0          0.13878          0.86122
 115 3                         0          0.02477          0.97523
 120 2                   0.01651           0.9039          0.07959
 125 3                         0          0.10719          0.89281
 130 2                   0.00694          0.98026           0.0128
 135 2                   0.01655          0.90962          0.07383
 140 3                         0          0.09791          0.90209
 145 3                         0          0.10719          0.89281
 150 3                         0          0.04876          0.95124

Download a zip file of all examples and a SQL script file that creates their input tables from the attachment in the left sidebar.