TD_KNN Input Table for Neighbors
Id |
MSSubClass |
MSZoning |
LotFrontage |
LotArea |
... |
SaleCondition |
SalePrice |
1 |
60 |
RL |
65 |
8450 |
... |
Normal |
208500 |
2 |
20 |
RL |
80 |
9600 |
... |
Normal |
181500 |
3 |
60 |
RL |
68 |
11250 |
... |
Normal |
22350 |
4 |
70 |
RL |
60 |
9550 |
... |
Abnormal |
140000 |
5 |
60 |
RL |
84 |
14260 |
... |
Normal |
250000 |
... |
... |
... |
... |
... |
... |
... |
... |
Example: TD_KNN SQL Call for Neighbors
SELECT * FROM TD_KNN(
ON housing_train AS TestTable PARTITION BY ANY
ON housing_train AS TrainingTable DIMENSION
USING
k(5)
InputColumns('[1:5]')
IDColumn('sn')
ModelType('Neighbors')
) AS dt;
TD_KNN Output Table for Neighbors
sn |
neighbor_id1 |
neighbor_id2 |
neighbor_id3 |
neighbor_id4 |
neighbor_id5 |
1 |
106 |
28 |
27 |
18 |
1 |
2 |
23 |
55 |
2 |
24 |
15 |
3 |
3 |
83 |
134 |
81 |
33 |
4 |
4 |
5 |
66 |
35 |
87 |
5 |
35 |
4 |
5 |
87 |
66 |