Machine Learning Specialization (Andrew Ng)

This playlist is my public study notebook while going through the Machine Learning Specialization, by Andrew Ng (DeepLearning.AI / Stanford), probably the most recommended course for anyone getting started in ML.

The idea here isn't just "solve the notebook and move on." Every lab in the course becomes a post where I retell what I understood, with an everyday-life metaphor, an example, and of course, the correct technical term, because you'll need it when you go looking for more on the topic later.

We start at the start: representing the simplest model there is, linear regression with one variable.

Playlists · 18 posts

  1. Optional Lab: Model Representation

    The simplest ML model there is, f(x) = wx + b, taken apart: why a line, what w and b actually mean, and why 'finding the parameters by hand' doesn't scale.

  2. Optional Lab: the Cost Function

    How to put a single number on how wrong a model is: J(w,b), why squared error, why divide by 2m, and why the cost surface is always a bowl.

  3. Optional Lab: Gradient Descent

    The algorithm that walks itself down to the bottom of the cost bowl: the math behind gradient descent, what happens when the learning rate is too big, and why it stops on its own near the minimum.

  4. NumPy and Vectorization

    Why every serious ML codebase uses NumPy instead of a Python list: vectors, matrices, the dot product, and the real (not the legendary) gap between a loop and a vectorized operation.

  5. Just a Little Extra: Loss Functions (MSE, MAE, Huber)

    Why we squared the error back in post 2, and what happens if you choose differently: MAE, Huber, and the real impact a single outlier has on each choice.

  6. Feature Scaling and Learning Rate

    Why the exact same gradient descent that worked fine so far breaks the moment one feature has a wildly different scale from the others, and how a basic statistics trick fixes it for good.

  7. Feature Engineering and Polynomial Regression

    How to make the exact same linear regression fit curves, by engineering new features instead of switching algorithms, and why that forced me to finally confront overfitting head-on.

  8. Linear Regression with Scikit-Learn

    After building gradient descent, normalization, and feature engineering by hand, I finally use scikit-learn, and find out the course's 'default' model hides two surprises nobody warns you about.

  9. Classification: Why Regression Isn't Enough

    Week 3, Lab 1: the course shows, in a very visual way, the same problem I'd already seen from a different angle back in the Pattern Recognition playlist: using linear regression to classify works fine until the wrong point shows up.

  10. The Sigmoid Function: Putting a Ceiling on Regression

    Week 3, Lab 2: linear regression's raw output had no ceiling, so the course squeezes it through a function that always returns something between 0 and 1. The sigmoid is exactly that: a way to squash any number into a probability.

  11. Decision Boundary: Where the Sigmoid Changes Its Mind

    Week 3, Lab 3: with two input variables, you can draw exactly where the model flips its decision. That line (or curve) has a name: decision boundary, and it lives entirely inside the model's linear part, before the sigmoid ever gets involved.

  12. Squared Error Doesn't Work Here: the Logistic Loss

    Week 3, Lab 4: the same cost function that worked so well for linear regression turns into a surface full of plateaus once it's squeezed behind a sigmoid. The fix is to swap the loss function, not the model.

  13. From Loss to Cost: Summing Up Everyone's Error

    Week 3, Lab 5: the logistic loss measures one patient's error. The cost sums that loss (averaged) over the whole training set into a single function, the one gradient descent actually minimizes. A real example shows how cost spots a worse boundary before I even look at the plot.

  14. Gradient Descent Didn't Need to Learn Anything New

    Week 3, Lab 6: after sigmoid, decision boundary, logistic loss and cost, only one piece is left to actually train something. Good news: that piece has existed since Week 1, the same gradient descent loop, just walking down a different hill.

  15. What Took Six Labs, Scikit-Learn Does in Three Lines

    Week 3, Lab 7: sigmoid, decision boundary, loss, cost and gradient descent, all hand-written over the last six labs, collapse into import, fit, predict. And the comparison with real sklearn drops a spoiler for the course's next topic.

  16. Memorized the Test, Didn't Learn the Subject

    Week 3, Lab 8: a model that's too flexible doesn't learn the pattern, it memorizes every training point by heart. That already showed up for regression; here the same cramming gets a new face, a decision boundary snaking around every single patient instead of actually separating the classes.

  17. Regularization: Keep Every Feature, Just Don't Let Any of Them Boss Around

    Week 3, Lab 9: of the three fixes for overfitting listed in the last lab, this is the one actually used in practice. Instead of cutting features, I keep all of them and just cap how large each weight is allowed to grow. Closes with the hook that this same idea, applied to two polynomial-mapped features, is exactly what the week's graded assignment asks you to build from scratch.

  18. From the First wx+b to Here: Closing the Course

    20 posts later, the specialization's first course (Supervised Regression and Classification) is done. A look back at what actually stuck, the certificate, and what this playlist taught me about reusing the same tool instead of learning a new one every chapter.