Class 19 - April 10

  1. Report 3

  2. Support Vector Machines

Question: What is the best hyperplane separating this data?

1. Report 3 Due Sunday April 22 at 11:59pm.

In a nutshell: build and test a classifier for these handwritten characters, using a decision tree and the SVM algorithm that we will study today. You may not use any canned machine-learning package, like sklearn: your code must all be written from scratch except for solving the quadratic programming problem with cvxopt.

Cross validation: Take some "training" subset of the PNG images that you think you might to use to to develop a classifier, and another subset that you will use to test the quality of your classifier.

In [2]:
%pylab inline
from PIL import Image
import glob
Populating the interactive namespace from numpy and matplotlib
In [6]:
pngs = sorted(glob.glob('class19_files/pngs/*aforthma*.png'))
for png in pngs:
    print(png)
    img = Image.open(png)
    imshow(img)
    break
class19_files/pngs/000_20170329_aforthma__0.png

SVM relies on quadratic programming

Minimizes a quadratic function subject to linear equality and inequality constraints

cvxopt is a nice package for solving such problems