Live data from Hacker News

Show HN: ML From Scratch – free online textbook

dafriedman97.github.io

1–10 of 56 posts

Re: Show HN: ML From Scratch – free online textbook

#2
I'm linking to a free online book I just finished called Machine Learning from Scratch. The book aims to cover the complete, technical, "under the hood" details that other ML textbooks don't. To do that, it shows all the mathematical steps to derive common algorithms and demonstrates how to fit each one from scratch in Python (using just numpy).

You might like this book if you are interested in ML and like to really understand what's going on behind the algorithms. Personally, when learning about these algorithms I would understand them intuitively but not feel comfortable constructing them myself. Even if you totally grasp the algorithms, seeing them derived from scratch is a great way to better understand the comparative advantages between competing models.

The code and math are pretty simple, so there should be a low barrier to entry.

I'm hoping to make the book somewhat of a breathing document, so if you have any edits, questions, or suggestions, I'm all ears. You can reach me at dafrdman@gmail.com. Thanks a lot!

Re: Show HN: ML From Scratch – free online textbook

#3
First thing I thought of when I read the title was sentdex's nnfs.io (neural networks from scratch.) I don't have time to look at this in full right now, are there any major differences between the these? From my quick glance over this looks like it's heavy on the math notation and when it gets to the code it's already getting to complex (for someone who doesn't know python) to read.

Re: Show HN: ML From Scratch – free online textbook

#4
Just did a quick scan and looks pretty good! Would it be possible to add an option for exporting the raw code (maybe broken down by chapter/section) separate from the notebooks? Ideally this would run self-contained without relying on state buildup in the notebooks.

Re: Show HN: ML From Scratch – free online textbook

#5
post #3

First thing I thought of when I read the title was sentdex's nnfs.io (neural networks from scratch.) I don't have time to look at this in full right now, are there any major differences between the these? From my quick glance over this looks like it's heavy on the math notation and when it gets to the code it's already getting to complex (for someone who doesn't know python) to read.

The approach to this book is very similar to nnfs.io (a similar focus on deriving models from the bare bones). The biggest difference is that his focuses on deep learning while mine covers a) a wider range of models and b) more introductory methods (linear regression, logistic regression, naive bayes, etc.)

It is definitely heavy on the math notation. Since the purpose of the book is to provide mathematical derivations, it's impossible to do that without lots of notation. That's why I added the notation and conventions page (right after the table of contents). If you do get a chance to look through it and see any notation in particular that is difficult to follow, please let me know and I'll update that page.

As for the code, knowing Python is a loose pre-requisite, but familiarity with object oriented programming in general should be enough to at least follow along. Most of the code does one of two things: 1) manipulates data represented as vectors/matrices or 2) creates/manipulates the objects themselves. But I should work on making the commenting clearer so it's apparent what each step does, even for someone less comfortable with Python.

Thanks so much for your feedback!

Re: Show HN: ML From Scratch – free online textbook

#6
post #3

First thing I thought of when I read the title was sentdex's nnfs.io (neural networks from scratch.) I don't have time to look at this in full right now, are there any major differences between the these? From my quick glance over this looks like it's heavy on the math notation and when it gets to the code it's already getting to complex (for someone who doesn't know python) to read.

Looks like this one is free and also covers a wider breadth of ML topics (though perhaps doesn't cover NNs in as much detail -- I don't have a paid copy of nnfs).

Re: Show HN: ML From Scratch – free online textbook

#7
post #4

Just did a quick scan and looks pretty good! Would it be possible to add an option for exporting the raw code (maybe broken down by chapter/section) separate from the notebooks? Ideally this would run self-contained without relying on state buildup in the notebooks.

Good call! I'll work on that ASAP

Re: Show HN: ML From Scratch – free online textbook

#9

Feedback for the authors: I had a really hard time finding the "graph_boundaries" code (I eventually saw the "Click to show" button on the right) I love the source code included, very handy for the future!

Thanks for the helpful feedback. I wanted to put emphasis on the graphs so I chose to hide the code but maybe it's not worth the cuteness of the "click to show". Changing that now.
Post reply on HN