LearnMachine learning

Naive Bayes

Classify with probabilities and a bold shortcut: within each class, assume every feature is independent of the others.

  • Machine learning
  • Supervised
  • Classification

Choose a colour and click to add points. Move the cursor over the chart to read the probability of pink at that spot.

How it works

Probability, one feature at a time.

Naive Bayes asks: given what I see, which class is more likely? It combines how common each class is (the prior) with how likely the observed values are for that class, using Bayes' rule.

To keep it simple, it treats the features as independent within each class and fits a bell curve to each feature of each class on its own. The dashed ellipses show those curves: they can stretch along x or y, but never tilt.

That naive shortcut is often wrong, yet the model still works surprisingly well, trains instantly and needs little data. When features are strongly linked, its probabilities become overconfident.