TD_KNN Input Table for Regression Example
Person_trainid |
height |
age |
weight |
0 |
5 |
32 |
67 |
1 |
5.11 |
45 |
98 |
2 |
5.9 |
46 |
78 |
3 |
4.8 |
35 |
86 |
4 |
5.8 |
22 |
70 |
... |
... |
... |
... |
Example: TD_KNN SQL Call for Regression
SELECT * FROM TD_KNN(
ON person_test AS TestTable PARTITION BY ANY
ON person_train AS TrainingTable DIMENSION
USING
K(2)
ResponseColumn('weight')
InputColumns('height','age')
IDColumn('id')
ModelType('regression')
EmitNeighbors('true’)
EmitDistances('true')
) AS dt ;
TD_KNN Output Table for Regression
id |
prediction |
neighbor_id1 |
neighbor_dist1 |
neighbor_id2 |
neighbor_dist2 |
11 |
88 |
4 |
0.7 |
2 |
1.004 |
12 |
80 |
8 |
20.00 |
4 |
41.00 |