Input
- input: iris_test, created in DecisionTree Example 1
- ModelTable: xgboost_model2, output by XGBoost Example 2: Multiple-Class Classification
SQL Call
CREATE MULTISET TABLE iris_predict AS ( SELECT * FROM XGBoostPredict ( ON iris_test AS "input" PARTITION BY ANY ON xgboost_model2 AS modeltable DIMENSION ORDER BY tree_id, iter, class_num USING IDColumn ('id') NumBoostedTrees (2) Accumulate ('species') ) AS dt ) WITH DATA;
Output
The table iris_predict is similar to the following table, but has 120 rows.
id | species | prediction | confidence_lower | confidence_upper |
---|---|---|---|---|
5 | 1 | 1 | 1 | 1 |
15 | 1 | 1 | 1 | 1 |
25 | 1 | 1 | 1 | 1 |
35 | 1 | 1 | 1 | 1 |
45 | 1 | 1 | 1 | 1 |
55 | 2 | 2 | 1 | 1 |
65 | 2 | 2 | 1 | 1 |
75 | 2 | 2 | 1 | 1 |
85 | 2 | 2 | 1 | 1 |
95 | 2 | 1 | 1 | |
105 | 3 | 3 | 1 | 1 |
115 | 3 | 3 | 1 | 1 |
125 | 3 | 3 | 1 | 1 |
135 | 3 | 3 | 1 | 1 |
145 | 3 | 3 | 1 | 1 |
... | ... | ... | ... | ... |