Adjust feature evidence and watch Naive Bayes compute posterior probabilities using Bayes theorem, step by step.
Naive Bayes is a classification algorithm built directly on Bayes' Theorem, a fundamental rule of probability for updating beliefs given new evidence. In plain terms: start with a prior belief about how likely each class is (before seeing any evidence), then update that belief based on how likely the observed evidence would be under each class, arriving at a posterior probability, your updated belief after accounting for the evidence. The visualization above walks through exactly this process for a classic spam classification example.
The "naive" in Naive Bayes refers to a simplifying assumption the algorithm makes, that all features are conditionally independent given the class. In the spam example, this means the algorithm assumes whether an email contains "free" and whether it contains "urgent" are treated as completely independent pieces of evidence, even though in reality, spam emails containing one suspicious word are probably more likely to contain others too, a real correlation the model ignores. This assumption is almost never perfectly true in real data, and yet Naive Bayes frequently performs surprisingly well in practice anyway, particularly for text classification tasks like spam filtering.
Without the independence assumption, calculating the true joint probability of all your evidence given a class would require modeling every possible interaction between features, computationally expensive and requiring far more training data than is typically available. By assuming independence, the algorithm can simply multiply together each feature's individual likelihood, exactly what the calculation trace above shows, turning a potentially intractable probability estimation problem into simple, fast multiplication. This trade-off, a wrong assumption in exchange for tractability and speed, is precisely why Naive Bayes remains a practical, widely-used baseline classifier despite its "naive" simplification.
Try setting the prior P(Spam) very low, say 5%, representing a mail system where spam is genuinely rare, and notice how much stronger the evidence needs to be to push the posterior above 50%. This reflects a real, important statistical truth, when a class is rare, even fairly strong evidence often isn't enough to overcome a low prior, which is exactly why base rates matter so much in real-world classification problems like rare disease screening, where even a fairly accurate test can produce mostly false positives if the underlying condition is rare enough.