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

3 · The maths the later courses assume

  • 7Probability for evaluation

    Exercise answers

    • Answer: Simulate an eval and compute kappa
  • 8Standard errors, intervals and paired tests
  • 9Vectors, dot products and embeddings
  • 10A small neural network from scratch
CapstoneTicket triage you can defendReference implementation

Module 3 · The maths the later courses assume · Lesson 7

Probability for evaluation

Proportions, Bernoulli and binomial trials, expected value and variance, conditional probability and Bayes' rule, and chance-corrected agreement, each worked on Hollowbrook's tickets and its two annotators.

75 min 2 videos 3 exercises 7-question quiz Answers
Setup for the exercises:Install Claude CodePython with uvThe Hollowbrook ticket data

By the end of this lesson you can

  • Model a pass/fail eval case as a Bernoulli trial and compute the binomial probability, mean and variance of k passes in n
  • Compute the expected value and variance of a discrete distribution by hand and in numpy, and say what the standard deviation tells you about a score
  • Read joint, marginal and conditional probabilities off a contingency table and check two events for independence
  • Apply Bayes' rule to P(truly urgent | flagged) at three base rates and explain why precision moves while the hit rate stays fixed
  • Derive expected agreement under independence and compute Cohen's kappa for two annotators labelling the same tickets

On this page

  • A pass/fail case is a biased coin
  • Thirty cases: the binomial
  • Joint, marginal and conditional probability
  • Bayes' rule and the base rate
  • Agreement beyond chance
  • Connections
  • Summary
  • Sources & further reading
  • Quiz

In this lesson

  1. 01A pass/fail case is a biased coin
  2. 02Thirty cases: the binomial
  3. 03Joint, marginal and conditional probability
  4. 04Bayes' rule and the base rate
  5. 05Agreement beyond chance
  6. 06Connections
  7. 07Summary

Sources & further reading

  • Survey Article: Inter-Coder Agreement for Computational LinguisticsPaper · Artstein, Poesio · 2008Sections 2 and 3 define chance-corrected agreement, derive kappa's expected-agreement term and discuss where kappa misleads (skewed labels, few categories).
  • Probability for Computer ScienceUniversity · Stanford (CS109 course reader) · 2026The conditioning, Bayes, independence, binomial and expectation chapters, in the order this lesson follows and with a programmer's examples.
  • RES.6-012 Introduction to ProbabilityUniversity · Tsitsiklis, Bertsekas · MIT OpenCourseWare · 2018Short video lectures with notes; the ones on conditioning, Bayes' rule and the binomial are the companion to this lesson if you want a second explanation.
  • Deep Learning, chapter 3: Probability and Information TheoryBook · Goodfellow, Bengio, Courville · 2016Sections 3.1 to 3.9 state the same ideas in the notation machine-learning papers use (random variables, marginal and conditional probability, expectation, variance, Bayes' rule).
  • Probabilistic Machine Learning: An Introduction, chapter 2Book · Murphy · 2022Probability: univariate models. The Bernoulli and binomial distributions and their moments, free draft PDF on the book page.
  • An Introduction to Statistical Learning with Applications in PythonBook · James, Witten, Hastie, Tibshirani, Taylor · 2023Chapter 4, sections 4.1 to 4.3, uses Bayes' theorem for classification; the same posterior this lesson computes for the urgent flag.
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.

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