# Handwritten Digit Recognition

> Command-line tool that recognizes handwritten digits with the KNN algorithm.

## Role

Developer (Data Mining course)

## Context

Data Mining coursework: implement a classifier from scratch instead of calling a library.

## Approach

- Loads MNIST images from one folder per label and binarizes them with Otsu thresholding.
- k-nearest neighbours written by hand: Euclidean distance over 784-pixel vectors and a majority vote.
- A menu sets the number of training and test samples and k, computes accuracy and predicts sample images.

Stack: Python, KNN

Repository: https://github.com/tdphatstudy/Handwritten-Digit-Recognition

Source: https://tdphat.io.vn/projects/handwritten-digit-recognition
