Learn practical skills, build real-world projects, and advance your career
Created 4 years ago
Handwritten Digit Recognition
Step 1: Define the Problem & Collect Data
Q: What are you trying to predict?
A: Classify images of handwritten digits into their 10 categories (0 to 9).
Q: What will your input data be?
A: Grayscale images of handwritten digits (28x28 pixels).
Q: What type of problem are you facing?
A: Binary classification
Q: What is the size of your dataset?
A: There are 60,000 training samples and 10,000 test samples.
from keras.datasets import mnist
(train_images, train_labels), (test_images, test_labels) = mnist.load_data()
import matplotlib.pyplot as plt
grid_size = 6
f, axarr = plt.subplots(grid_size, grid_size)
for i in range(grid_size):
for j in range(grid_size):
axarr[i, j].imshow(train_images[i * grid_size + j])