Games

Draw a digit

vs. KNN classifier

Draw with a mouse, finger or pen. With the keyboard: arrow keys move the pen, Space puts it down or lifts it, Delete clears.

–

Prediction

Waiting for ink

28×28

Weighted vote

  1. 0
  2. 1
  3. 2
  4. 3
  5. 4
  6. 5
  7. 6
  8. 7
  9. 8
  10. 9

Nearest training digits, closest first

    The closest matches from the training set appear here.

    Loading 750 MNIST training digits… Everything runs in your browser: your drawing is cropped, scaled to 20px and centred by mass on a 28×28 grid, the same way MNIST was prepared, then compared pixel by pixel against every training digit.

    How to play

    Draw a digit

    Draw a single digit in the pad with a mouse, finger or stylus. The classifier updates as you draw and shows the training digits it matched.

    Change k to see how many neighbours get a vote. Small k trusts the single closest match; large k lets more distant digits outvote it.