...

/

MNIST: Handwritten Digits Dataset

MNIST: Handwritten Digits Dataset

Practice and compare simple logistic regression with support vector machines.

We’ll explore the available kernel options in SVMs and compare their performance against each other and against simple logistic regression. We are going to work with three different datasets. Let’s perform the required imports first.

Press + to interact
# required imports
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(font_scale=1.3) # setting font size for the whole notebook
sns.set_style("white") # want to set the style
from sklearn import svm, linear_model, datasets
from sklearn.model_selection import cross_val_score

Let's move on to our first dataset.

The data

The Modified National Institute of Standards and Technology (MNIST) database of handwritten digits (28×2828×28 pixel grayscale images) consists of 60,000 training and 10,000 test examples. The dataset is a subset of a larger set available from NIST special database 3 (digits written by employees of the United States Census Bureau) and special database 1 ...

Access this course and 1400+ top-rated courses and projects.