Tracing a Boundary

If we hope to understand classification intuitively, then we need a dataset that we can visualize easily. MNIST, with its mind-boggling hundreds of dimensions, is way too complex for that. Instead, we’ll use a simpler, brain-friendly dataset:

 Input_A Input_B Label
 -0.470680718301 -1.905835436960 1
 0.9952553595720 1.4019246363100 0
 -0.903484238413 -1.233058043620 1
 -1.775876322450 -0.436802254656 1

Those are just the first few lines. The file contains 300 examples in total, each with two input variables and a binary label. I wrote a program to plot these data, that you can find in the book’s source code as usual. (It’s called plot_data.py.) It uses the two input variables as coordinates, ...

Get Programming Machine Learning now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.