Input
- AttributeTableName: iris_attribute_train
- ResponseTableName: iris_response_train
The preceding tables are created in DecisionTree Example 1.
SQL Call
DROP TABLE IF EXISTS iris_attribute_output ; DROP TABLE IF EXISTS splits_small ; SELECT * FROM DecisionTree ( ON iris_attribute_train AS AttributeTableName ON iris_response_train AS ResponseTableName OUT TABLE OutputTable (iris_attribute_output) OUT TABLE IntermediateSplitsTable (splits_small) USING NumSplits (3) SplitMeasure ('gini') MaxDepth (10) IDColumns ('pid') AttributeNameColumns ('attribute') AttributeValueColumn ('attrvalue') ResponseColumn ('response') MinNodeSize (10) ApproxSplits ('false') OutputResponseProbDist ('true') ) AS dt;
Output
This query returns the following table:
SELECT * FROM iris_attribute_output;The table looks like iris_attribute_output in DecisionTree Example 1, except that it has additional columns left_label_probdist, right_label_probdist, and prob_label_order.
node_id | node_size | node_gini_p | node_entropy | node_chisq_pv | node_label | node_majorvotes | split_value | split_gini_p | split_entropy | split_chisq_pv | left_id | left_size | left_label | left_majorvotes | right_id | right_size | right_label | right_majorvotes | left_bucket | right_bucket | left_label_probdist | right_label_probdist | prob_label_order | attribute ---------+-----------+--------------------+-------------------+---------------+------------+-----------------+------------------+--------------------+--------------------+----------------------+---------+-----------+------------+-----------------+----------+------------+-------------+------------------+-------------+--------------+-------------------------+-------------------------+------------------+---------------- 0 | 120 | 0.666666666666667 | 1.58496250072116 | 1 | 1 | 40 | 3 | 0.333333333333333 | 0.666666666666666 | 0 | 1 | 40 | 1 | 40 | 2 | 80 | 2 | 40 | | | 0.02326,0.02326,0.95349 | 0.49398,0.49398,0.01205 | 3,2,1 | petal_length 2 | 80 | 0.5 | 1 | 1 | 2 | 40 | 1.70000004768372 | 0.0719199499687304 | 0.227979833481065 | 1.11022302462516e-16 | 5 | 39 | 2 | 38 | 6 | 41 | 3 | 39 | | | 0.04762,0.92857,0.02381 | 0.90909,0.06818,0.02273 | 3,2,1 | petal_width 6 | 41 | 0.0928019036287924 | 0.281193796432043 | 1 | 3 | 39 | 4.90000009536743 | 0.0840474620962426 | 0.240916755467913 | 0.0492232443463754 | 13 | 4 | 3 | 3 | 14 | 37 | 3 | 36 | | | 0.57143,0.28571,0.14286 | 0.92500,0.05000,0.02500 | 3,2,1 | petal_length 5 | 39 | 0.0499671268902038 | 0.172036949353113 | 1 | 2 | 38 | 4.90000009536743 | 0.0384615384615385 | 0.0832080127650393 | 0.00272911340977045 | 11 | 35 | 2 | 35 | 12 | 4 | 2 | 3 | | | 0.02632,0.94737,0.02632 | 0.28571,0.57143,0.14286 | 3,2,1 | petal_length 14 | 37 | 0.0525931336742148 | 0.179256066928321 | 1 | 3 | 36 | 2.90000009536743 | 0.0518018018018018 | 0.162085811567472 | 0.455587679837851 | 29 | 13 | 3 | 13 | 30 | 24 | 3 | 23 | | | 0.87500,0.06250,0.06250 | 0.88889,0.07407,0.03704 | 3,2,1 | sepal_width 30 | 24 | 0.0798611111111112 | 0.249882292833186 | 1 | 3 | 23 | 3.20000004768372 | 0.0773809523809524 | 0.216552190540511 | 0.387955122826146 | 61 | 14 | 3 | 13 | 62 | 10 | 3 | 10 | | | 0.82353,0.11765,0.05882 | 0.84615,0.07692,0.07692 | 3,2,1 | sepal_width 61 | 14 | 0.13265306122449 | 0.371232326640875 | 1 | 3 | 13 | 6.30000019073486 | 0.131868131868132 | 0.363297594798595 | 0.773484680980946 | 123 | 1 | 3 | 1 | 124 | 13 | 3 | 12 | | | 0.50000,0.25000,0.25000 | 0.81250,0.12500,0.06250 | 3,2,1 | sepal_length (7 rows)