Machine learning

Stage 2 · Lesson 6 of 9

Probability and Bayes' theorem

The maths you need

is the language of uncertainty, and it runs through ML. A spam classifier outputs P(spam | email), the chance an email is spam given what it says, not a certainty. Learn joint, marginal and conditional probability, independence, and Bayes' theorem: P(A | B) = P(B | A) × P(A) / P(B).

Bayes explains the trap. Say a disease affects 1% of people and a test is 99% accurate. A positive result then means only about a 50% chance of having it.

Why? The from the 99% of healthy people roughly equal the from the sick 1%. The same logic explains why a fraud model that catches most fraud (high recall) can still flag mostly innocent transactions.

Work these out with counts from a table of 10,000 people; it is far more intuitive than the formula alone.

A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock

Resources for this stage

Start with· follow one of these

Keep handy

Also worth your time

Mark this stage as not done?