Intuition, math, code: Creating two Hands-on Data Science courses for myself
I recently published the courses on GitHub: mhassanpur/hands-on-data-science.
I have a long list of data science courses I started and never finished. Andrew Ng's Stanford lectures. Andrej Karpathy's videos on building a language model from scratch. Several others over the past few years. None of them are bad courses, but for one reason or another I struggled to complete them.
Some of it was time and some of it was that my math had been sitting untouched since college. Mostly though, the material wasn't optimized for my learning style.
What works for me is three passes over the same idea. First the intuition, in plain language to explain the high-level concepts. Then the math, which I'll admit is the part that's most intimidating until I'm actually sitting with it. Then applying it to a real problem, which is the pass that makes it stick. When a course gives me the math first, or jumps too quickly to application, I follow along fine but retain very little.
Sweeping the math stack
This all started as a chat thread. I'd been going back and forth with a model on specific topics, pushing into the math whenever an explanation didn't sit right, and it became obvious that my math was a little rusty. Rather than patch individual gaps, I reviewed the whole stack: number theory, algebra, trigonometry, geometry, calculus, differential equations, discrete math, and linear algebra.
Most of it came back fast. The point of the sweep was to find out where the real gaps were, and once I lined the results up against data science it became clear that linear algebra was the most critical piece. Coming from a software engineering background, it's the one I encountered in many domains but never felt too confident in. So I asked the model to walk me through a curriculum for it, and after working through the concepts again, the math stopped being the part I flinched at. Things started clicking.
The courses
That's when I asked for notebooks. Deep learning came first: a series of Python notebooks that would explain the field to someone who could already write code. The structure we landed on follows the evolution of the research. Each chapter opens on the question the one before it left hanging, and the architecture in it is somebody's answer to that question.
That framing is the reason the course worked on me where lectures hadn't. I've worked on traditional ML projects before, so I watched this field change from the sidelines for years without the view into the technical problems driving it. Chapters 5 through 8, for example, are three different answers to a single problem that chapter 5 sets up and then fails to solve. Read in that order, the ideas stop being a list of architectures to memorize and start being a chain of reasoning I can follow.
Once the deep learning course existed I went back and had the model organize linear algebra the same way, since that's where most of my gaps had been.
What ended up in the repo is nine linear algebra notebooks and seventeen on deep learning.
The linear algebra course runs from the definition of a vector to the singular value decomposition, building elimination, RREF, null-space bases, inverses, determinants, power iteration, and Gram-Schmidt by hand before checking any of them against NumPy. The interactive notebooks help reinforce the concepts in a way that is both visual and hands-on.
The deep learning course opens with a single neuron trained on hand-derived gradients and ends on diffusion transformers, vision-language models, state space models, and the kernel work that decides what fits on one GPU. Chapters 1 through 8 are Keras and 9 through 17 are PyTorch, because the reference implementations for everything in the back half are torch and I wanted to be able to diff my work against the real thing. That back half runs on a GPU, and the constants driving training time are marked inline so a chapter can be tuned down to fit the hardware you have.
Every concept gets the three passes, in the same order every time. Nothing is imported before it has been built at least once. And every number a notebook claims is computed in the notebook, which mattered more than I expected going in.
Take it, or make your own
I put the courses up under MIT because they might be useful to someone with a similar background, and if you work through any of it I'd like to hear where it falls short. I'm planning to use it as the foundation for some toy models, which will probably expose a few weak spots on its own.
I'll also go back to the courses I bounced off. Building my own got the math solid and got me moving again, which is mainly what I wanted from it, and I expect I'll get further into Ng's lectures this time than I did before.
The curriculum isn't the most interesting part though. My approach is three passes in a fixed order, written for an experienced engineer, because that's what works for me. Yours is probably different. Feel free to fork and make it your own, or take inspiration and build yourself a curriculum for something that you've been struggling to learn.