Input
See KNN Examples Input.
SQL Call
SELECT * FROM KNN ( ON computers_train1_clustered AS TrainingData ON computers_test1 AS TestData OUT TABLE OutputTable (knn_output_1) USING K (50) ResponseColumn ('computer_category') TargetColumns ('price','speed','hd','ram','screen') VotingWeight (1) TestIDColumn ('id') OutputProb ('t') ) AS dt ;
Output
This query returns the following table:
SELECT * FROM knn_output_1;
id prediction prob ----------- -------------------- ---------------------- 91 hyper 1.00000000000000E 000 93 mega 1.00000000000000E 000 112 super 1.00000000000000E 000 122 super 1.00000000000000E 000 135 special 6.57223859017317E-001 153 uber 1.00000000000000E 000 199 super 1.00000000000000E 000 209 mega 9.68588381270587E-001