Skip to main content

Visualizing popular machine learning algorithms

I put together an experiment to compare different classification machine learning algorithms in real time to gain insight into which ones handle certain situations better than others: http://jsfiddle.net/wybiral/3bdkp5c0/embedded/result/

Currently the algorithms covered are:
  • Linear regression (with cubic expansion on feature space)
  • Logistic regression (with cubic expansion on feature space)
  • Neural network (sigmoidal feed forward back propagation)
  • K nearest neighbor (where k=5)
  • Naive bayes
  • Support vector machine (gauss kernel)
  • Discriminate analysis
The bottom dropdown has a few simple datasets but you can also click on the classification space to add new blue/orange points.

As the algorithm trains you'll see the background color morph to display the classification boundary. Change the algorithm (via the dropdown on the top) and see how it impacts the classification boundary.

Comments

Heri said…
Good work. You might want to look here https://news.ycombinator.com/item?id=10444957

What is the nerdy.js library? There's only the minified version in the fiddle

Thanks
Wybiral said…
Hey, thanks. Nerdy.js is a Javascript library I put together years ago to implement the concept of datasets and machine learning algorithms. It was built using NumericJS (http://www.numericjs.com/) to handle the matrix operations.

I've thought about polishing it a bit and releasing it to the open source community, but I'm not sure what kind of demand there is for machine learning in Javascript.

Popular posts from this blog

Procedural music with PyAudio and NumPy

Combining two of my favorite pastimes, programming and music... This is the hacky "reduced to it's basic components" version of a library I've been working on for generating music and dealing with music theory.

Tweaking the harmonics by changing the shape of the harmonic components and ratios can produce some interesting sounds. This one only uses sine waveforms, but a square / saw generator is trivial with numpy.

It takes a second to generate, so don't turn your volume up too loud in anticipation (it may be loud).

import math
import numpy
import pyaudio
import itertools
from scipy import interpolate
from operator import itemgetter


class Note:

NOTES = ['c','c#','d','d#','e','f','f#','g','g#','a','a#','b']

def __init__(self, note, octave=4):
self.octave = octave
if isinstance(note, int):
self.index = note
self.note = Note.NOTES[note]
elif isinstance(note, st…

Build a Feed Reader in Python (Parts 7-9)

Part 07 Adding Jinja2 templates to a flask web application.

 Part 08 Adding static files so we can serve some CSS to style our app.

Part 09 Adding a background task to continuously update the articles while the application is running.

Write a Feed Reader in Python

I just started a new video tutorial series. This time it'll cover the entire process of writing an RSS feed reader in Python from start to finish using the feedparser module, flask, and SQLAlchemy. Expect to see about 3-4 new videos a week until this thing is finished!
Click to watch