Coders In Hoods
  • Courses
  • Roles
  • Blog
  • Setup

Coders In Hoods AI Academy

Every course is free. Sign in to start, and your progress, quiz scores and bookmarks follow you.

AI Academy

  • Courses
  • Paths
  • Setup guides
  • How we teach

Role roadmaps

  • AI Engineer
  • Forward Deployed Engineer
  • Machine Learning Engineer
  • All roles

Coders In Hoods

  • The agency
  • Coaching for teams
  • Blog
  • LinkedIn
  • X (Twitter)

Contact

codersinhoods@gmail.com

© Coders In Hoods · since 2019

Course overview

Machine Learning Foundations for LLM Work

Free · sign in to start and track progress

1 · Learning from data

  • 1Problems, data and baselines
  • 2Train, validation, test and leakage
  • 3Loss functions and gradient descent

2 · Classifiers and generalisation

  • 4Logistic regression, step by step
  • 5Metrics, thresholds and calibration
  • 6Overfitting, regularisation and cross-validation

    Exercise answers

    • Answer: Learning curves, cross-validated regularisation and a second model
    • Answer: Double descent on a laptop

3 · The maths the later courses assume

  • 7Probability for evaluation
  • 8Standard errors, intervals and paired tests
  • 9Vectors, dot products and embeddings
  • 10A small neural network from scratch
CapstoneTicket triage you can defendReference implementation

Module 2 · Classifiers and generalisation · Lesson 6

Overfitting, regularisation and cross-validation

Why a model that fits its training tickets can fail on new ones, the bias–variance picture and where double descent breaks it, and the tools that keep a model honest: regularisation, early stopping, cross-validation with folds that respect time and groups, and a boosted-tree baseline fitted on the same split.

85 min 2 videos 3 exercises 7-question quiz Answers
Setup for the exercises:Install Claude CodePython with uvThe Hollowbrook ticket dataRun Hugging Face models on CPU

By the end of this lesson you can

  • Produce and read learning curves against model capacity and against training epochs, and point to underfitting and overfitting on each
  • Explain bias and variance with the polynomial example, and state what double descent adds to the classical picture
  • Apply L2 (ridge) and L1 (lasso) penalties, tune their strength with k-fold cross-validation, and explain why folds must respect time and groups
  • Train a gradient-boosted tree model as the tabular baseline and compare it with logistic regression on the same split and metric
  • Explain why early stopping, weight decay and dropout are one idea, and why more epochs can make a fine-tune worse

On this page

  • A model that is too good at the training set
  • Bias, variance and the U
  • The same U against epochs
  • Regularisation: paying for large weights
  • Cross-validation: choosing without burning the validation set
  • Folds that respect time and groups
  • A second model: boosted trees
  • What double descent adds
  • Connections
  • Summary
  • Sources & further reading
  • Quiz

In this lesson

  1. 01A model that is too good at the training set
  2. 02Bias, variance and the U
  3. 03Regularisation: paying for large weights
  4. 04Cross-validation: choosing without burning the validation set
  5. 05A second model: boosted trees
  6. 06What double descent adds
  7. 07Connections
  8. 08Summary

Sources & further reading

  • Reconciling modern machine learning practice and the bias-variance trade-offPaper · Belkin, Hsu, Ma, Mandal · 2018The paper that named double descent. Section 1 and figure 1 give the whole picture; section 3 has the random-features experiment the stretch exercise reproduces.
  • Deep Double Descent: Where Bigger Models and More Data HurtPaper · Nakkiran, Kaplun, Bansal, Yang, Barak, Sutskever · 2019Double descent in model size, in training epochs and in dataset size for modern networks. Sections 1 and 2 define "effective model complexity"; the rest is experiments.
  • Understanding deep learning requires rethinking generalizationPaper · Zhang, Bengio, Hardt, Recht, Vinyals · 2016Networks fit random labels perfectly, so capacity alone cannot explain why they generalise on real labels. Sections 1 and 2 are enough.
  • Model Evaluation, Model Selection, and Algorithm Selection in Machine LearningPaper · Raschka · 2018A tutorial-length treatment of holdout, k-fold and nested cross-validation and the biases of each. Sections 3 and 4 for k-fold and its variants.
  • Why do tree-based models still outperform deep learning on tabular data?Paper · Grinsztajn, Oyallon, Varoquaux · 2022The benchmark evidence that gradient-boosted trees are the baseline to beat on tables of numeric and categorical columns, and the inductive-bias explanation in section 5.
  • An Introduction to Statistical Learning with Applications in Python, chapters 5 and 6Book · James, Witten, Hastie, Tibshirani, Taylor · 2023Chapter 5 is resampling (cross-validation and the bootstrap); chapter 6 is shrinkage (ridge and lasso) with the bias–variance derivation. The free PDF is linked from the site.
  • Cross-validation: evaluating estimator performance (scikit-learn user guide)Docs · scikit-learnSection 3.1, especially the iterators for grouped and time-ordered data (`GroupKFold`, `TimeSeriesSplit`) and the warning about fitting preprocessing inside the fold.
Free · sign in to start

Sign in to keep reading.

Free, no card. We use your account to save progress, quiz scores, bookmarks and occasionally send updates from our team.

  • 8 more sections
  • 3 hands-on exercises
  • A 7-question quiz
  • Progress, quiz scores and bookmarks