knn example with digit recognition

This commit is contained in:
Aditya Bhargava
2018-08-24 11:12:22 -07:00
parent e206a13153
commit f3805c8a3f
12 changed files with 135 additions and 0 deletions

11
10_knn/README.md Normal file
View File

@@ -0,0 +1,11 @@
## 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:
![](/images/16_correct_500_comparisons.tif)
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](http://yann.lecun.com/exdb/mnist/)