DecisionTreePredictの例: OutputProb、応答 - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - Advanced SQL Engine分析関数

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
2020年6月
Language
日本語
Last Update
2021-03-30
dita:mapPath
ja-JP/mld1565890109978.ditamap
dita:ditavalPath
ja-JP/mld1565890109978.ditaval
dita:id
B035-1206
Product Category
Software
Teradata Vantage

入力

<DecisionTreePredictの入力例>を参照してください。

SQL呼び出し

SELECT * FROM DecisionTreePredict (
  ON iris_attribute_test AS AttributeTable PARTITION BY pid
  ON iris_attribute_output AS Model DIMENSION
  USING
  AttrTableGroupByColumns ('attribute')
  AttrTablePIDColumns ('pid')
  AttrTableValColumn ('attrvalue') 
  OutputResponseProbDist ('true')
  Responses ('1','2','3')
) AS dt 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.06250 0.12500 0.81250
110 3 0.07692 0.07692 0.84616
115 3 0.06250 0.06250 0.87500
120 3 0.14286 0.57143 0.28571
125 3 0.07692 0.07692 0.84616
130 3 0.14286 0.57143 0.28571
135 3 0.14286 0.57143 0.28571
140 3 0.06250 0.12500 0.81250
145 3 0.07692 0.07692 0.84616
150 3 0.25000 0.25000 0.50000