DecisionTreePredict_MLE Example: OutputProb, Responses | Teradata Vantage - DecisionTreePredict_MLE Example: OutputProb, Responses - 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

SQL Call

CREATE MULTISET TABLE singletree_predict2 AS (
  SELECT * FROM DecisionTreePredict_MLE (
    ON iris_attribute_test AS AttributeTable PARTITION BY pid
    ON iris_attribute_output_prob AS Model DIMENSION
  USING
  AttrTableGroupbyColumns ('attribute')
  AttrTablePidColumns ('pid')
  AttrTableValColumn ('attrvalue')
  OutputProb ('true')
  Responses('1','2','3')
) AS dt
) WITH DATA;

Output

SELECT * FROM singletree_predict2 ORDER BY pid;
 pid pred_label prob_for_label_1 prob_for_label_2 prob_for_label_3 
 --- ---------- ---------------- ---------------- ---------------- 
   5 1                   0.95348          0.02326          0.02326
  10 1                   0.95348          0.02326          0.02326
  15 1                   0.95348          0.02326          0.02326
  20 1                   0.95348          0.02326          0.02326
  25 1                   0.95348          0.02326          0.02326
  30 1                   0.95348          0.02326          0.02326
  35 1                   0.95348          0.02326          0.02326
  40 1                   0.95348          0.02326          0.02326
  45 1                   0.95348          0.02326          0.02326
  50 1                   0.95348          0.02326          0.02326
  55 2                   0.02632          0.94736          0.02632
  60 2                   0.02632          0.94736          0.02632
  65 2                   0.02632          0.94736          0.02632
  70 2                   0.02632          0.94736          0.02632
  75 2                   0.02632          0.94736          0.02632
  80 2                   0.02632          0.94736          0.02632
  85 2                   0.02632          0.94736          0.02632
  90 2                   0.02632          0.94736          0.02632
  95 2                   0.02632          0.94736          0.02632
 100 2                   0.02632          0.94736          0.02632
 105 3                    0.0625            0.125           0.8125
 110 3                   0.07692          0.07692          0.84616
 115 3                    0.0625           0.0625            0.875
 120 2                   0.14286          0.57143          0.28571
 125 3                   0.07692          0.07692          0.84616
 130 2                   0.14286          0.57143          0.28571
 135 2                   0.14286          0.57143          0.28571
 140 3                    0.0625            0.125           0.8125
 145 3                   0.07692          0.07692          0.84616
 150 3                      0.25             0.25              0.5

Download a zip file of all examples and a SQL script file that creates their input tables.