Friday, October 23, 2015

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.

2 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.