Day 16

April 4, 2017

PLA, cont'd

My Day 15 notebook


Pocket PLA for almost-separated data.

Support Vector Machines

PLA works, but it doesn't usually give us the best separator we could wish for!

Maximum-margin classifier and SVM

This is the method you will use for character recognition, which is the subject of your next report.

Try this one by eye

Can be formulated as a quadratic programming problem.

2017_04_04/20170404_093952.jpg 2017_04_04/20170404_094006.jpg

Quadratic programming

Minimize a quadratic function subject to linear equality and inequality constraints

cvxopt is a nice package for solving such problems

quadratic_programming_cvxopt_hello.png quadratic_programming_cvxopt_hello1.png

Quiz ...

2017_04_04/20170404_101223.jpg 2017_04_04/20170404_105504.jpg

Handwritten characters: feature extraction

Here are your handwritten characters (download and unpack)

Let us write code to extract some features that might be useful for recognition.

%pylab inline
from PIL import Image
import glob
Populating the interactive namespace from numpy and matplotlib
pngs = sorted(glob.glob('pngs/*aforthma*.png'))

for png in pngs:
         img =