K-NN Interactive Demo

This webpage provides an interactive demo of the K-NN (K-Nearest Neighbors) algorithm for teaching purposes.

1) Enter some training data in the textbox below. The first line is a list of attribute names. Then, each following line is an instance consisting of numerical or categorical values, separated by single spaces:

2) Choose a value of K using the slider:

1

3) Write an instance to classify, where the attribute value to guess is replaced by the value "?":

 

Output:

 

--
Want to try a fast implementation of K-NN in Java ? Check the open-source SPMF data mining software
Return to the list of online tools

---
© Philippe Fournier-Viger, 2023