top of page
Ridge and Lasso Regression (82 Pages)

Ridge and Lasso Regression (82 Pages)

$49.00Price

You can already ask an AI to write you a ridge or lasso regression. The problem is knowing why an input measured in millimeters gets penalized more than the same input measured in meters, why the lasso keeps one of two correlated sensors and drops the other almost at random, or why a library's alpha is quietly not the lambda in your notes. None of that is visible from model.fit(). This is the course that gives you that judgment.


Five parts, one algorithm, no gaps:

·        Part 1 — Intro. Why charging a price for large coefficients steadies a fit that correlated inputs would otherwise throw around, why penalizing squared coefficients shrinks every slope while penalizing absolute values switches some off entirely, and how coordinate descent fits both one coefficient at a time. The intuition before the notation.

·        Part 2 — By Hand. A complete worked example: six test prints, three correlated process settings, and four full sweeps of coordinate descent for ridge and four for the lasso, twenty-four coordinate updates with every partial correlation, soft-threshold and objective shown. Nothing waved away, nothing left "as an exercise." You watch the lasso switch print speed off in the very first sweep and confirm both answers against exact solutions.

·        Part 3 — In Excel. The same example built out in a workbook of live formulas, one sweep per row, carried to 25 sweeps so you can watch both methods converge — then change the penalty or a single measurement and see the lasso drop settings while ridge only shrinks them.

·        Part 4 — In Python. A clean, executable, verified reference implementation that checks its own answer, ridge against its closed-form solution and the lasso by brute force over every sign pattern — the known-good version you can check any other code against.

·        Part 5 — With AI. A tested prompt that directs an AI assistant to carry this same algorithm to your problem, plus the understanding to catch it when it's wrong.


By the end you won't just have working code. You'll have followed the algorithm from first principles through a hand calculation, a spreadsheet, and production Python — so when you point an AI at your own data, you'll know how to standardize inputs before you penalize them, choose between shrinking and selecting on purpose, read a library's penalty convention before trusting its output, and tell when the answer is right.

    bottom of page