Live data from Hacker News

Machine Learning from scratch: Bare bones implementations in Python

github.com

31–40 of 67 posts

Re: Machine Learning from scratch: Bare bones implementations in Python

#31
post #2

One quick comment: in general it is a bad idea to compute the inverse of a matrix (to solve a linear system). It's much better to compute the QR factorization or SVD instead (or simply call least square solver). See for example: https://www.johndcook.com/blog/2010/01/19/dont-invert-that-m...

Thank you for the feedback. :) I plan on fixing this soon!

Not very important and for a learning project I find using cvxpy a better idea as it's more readable ( like you did ) but:

Solving the full quadratic optimization problem for SVMs in basically impossible to do. You are forming an n^2 matrix, so I'm going to let you imagine what happens when n = 100 000.

Using people use either approximation methods ( Incomplete Cholesky, Nystrom ) or do it exactly but iteratively ( SMO, Pegasos... )

I'm implementing them for class right now so it's still fresh in my head haha

Re: Machine Learning from scratch: Bare bones implementations in Python

#32

This is a nice project. I think it would be great to add references used for the implementations and some tests that demonstrate they return what is expected (or perhaps the same result of sklearn maybe).

Those are great suggestions. I will look into adding that.

Re: Machine Learning from scratch: Bare bones implementations in Python

#37
post #27

Would you suggest any books/resources to learn the theory behind these implementations so a newbie can follow along?

Pattern recognition and machine learning by Bishop is one of the canonical text books. It helps to have a linear algebra background, it includes a refresher though

Bishop is good but reads a little too much like a literature review sometimes. That may or may not be a problem depending on what you are looking for.
Post reply on HN