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_2) USING K (50) ResponseColumn ('computer_category') TargetColumns ('price','speed','hd','ram','screen') VotingWeight (1) TestIDColumn ('id') OutputProb ('t') Responses ('extreme','hyper','mega','special','super','uber','ultra','ultrasuper') ) AS dt ;
Output
This query returns the following table:
SELECT * FROM knn_output_2 ORDER BY id;
id prediction prob_extreme prob_hyper prob_mega prob_special prob_super prob_uber prob_ultra prob_ultrasuper ----------- -------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- 91 hyper 0.00000000000000E 000 1.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 93 mega 0.00000000000000E 000 0.00000000000000E 000 1.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 112 super 0.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 1.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 122 super 0.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 1.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 135 special 0.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 6.57223859017317E-001 3.42776140982683E-001 0.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 153 uber 0.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 1.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 199 super 0.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 1.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000 209 mega 0.00000000000000E 000 0.00000000000000E 000 9.68588381270587E-001 0.00000000000000E 000 3.14116187294131E-002 0.00000000000000E 000 0.00000000000000E 000 0.00000000000000E 000