Skip to content

Latest commit

 

History

History
 
 

10_knn

Digit recognition with knn

Here's some example Matlab code that shows KNN in action to guess handwritten digits. Here's what the output looks like:

Each row represents a guess. The last column contains the image that we're trying to guess the digit for. The first three columns show the 3 nearest neighbors for that last image.

Images with boxes around them represent images that we did not guess correctly. You can see KNN works pretty well -- with just 500 comparison images we are getting 80% accuracy. This jumps to 90% with 5000 comparison images (see the images/ directory).

Uses the MNIST dataset