AI GLOSSARY · AI CONCEPTS

Naive Bayes

Markdown version · Wikidata Q812530

Definition

Naive Bayes is a family of supervised classification algorithms that apply Bayes' theorem while assuming each feature is independent of the others given the class. The assumption is simplistic, which is why it is called naive.

Also called: naive Bayes classifier, naive Bayes algorithm, naive Bayes classification, multinomial naive Bayes.

In plain language

Naive Bayes sorts things into categories, such as spam or not spam, using estimated probabilities. In a multinomial text classifier, word counts estimate word likelihoods for each category, usually with smoothing to handle unseen words. The classifier combines those likelihoods with the prior probability of each category and chooses the highest posterior. It assumes features are independent given the category, which is often unrealistic for writing. Other family members use different feature distributions. It is quick to fit, but its reported probabilities can be poorly calibrated; check them on suitable held-out data before treating them as chances.

Technical definition

Naive Bayes applies Bayes' theorem to estimate P(class | features) from P(class) and the product of P(feature | class) terms, using the naive assumption that features are conditionally independent given the class. Each per-feature distribution is estimated separately as a one-dimensional distribution, which the scikit-learn guide says helps alleviate problems from the curse of dimensionality. Variants differ in the distribution assumed for each feature, such as Gaussian, multinomial and Bernoulli. The predicted class is the one with the highest posterior. The scikit-learn user guide says naive Bayes is known as a decent classifier but a bad estimator, so predict_proba outputs are not to be taken too seriously.

Worked examples in this catalogue

Catalogue examples point at a skill, guide or coding tool listed on this site, with what to run and what you see. An example marked illustrative describes the item from its own documentation; it was not executed for this page. Platform Scores are our assessment under a published method, not a safety guarantee.

  1. Skill by Skill Almanac · Illustrative, not executed

    split-leakage-check 53/100 · Provisional, not yet measuredScored · Method v0.2 · How we score

    What you see
    A JSON report that checks train, validation and test files for duplicates, shared groups, time leakage and label leakage.
    Why it exercises the concept
    This inspected skill checks selected split-file leakage signals before evaluation. It does not train Naive Bayes or establish that a score is trustworthy.
  2. Skill by Hugging Face · Illustrative, not executed

    huggingface-datasets 25/100 · Provisional, not yet measuredScored · Method v0.2 · How we score

    What you see
    Metadata, rows, search and filters for a Hugging Face dataset, read through the Dataset Viewer API.
    Why it exercises the concept
    This dataset reader can show labelled rows before fitting a supervised classifier; it does not fit the classifier.
  3. Skill by Skill Almanac · Illustrative, not executed

    data-analysis-eda 56/100 · Provisional, not yet measuredScored · Method v0.2 · How we score

    What you see
    A fixed exploratory-analysis procedure and a CSV profiler, with findings kept descriptive, evidenced and caveated.
    Why it exercises the concept
    Profiling a table shows column types, gaps and spread that inform feature-distribution choices. This inspected profiler does not train a classifier.

How it shows up when you use agents

Naive Bayes is a classic method, not something a coding agent runs by itself. It appears when you ask Claude Code, Codex or Cursor to build a small text classifier, for example a spam or topic filter, and the agent reaches for a scikit-learn naive Bayes class because it needs little code and few settings. It belongs to the family of supervised learning methods, so it needs labelled examples. See Classification for the task it solves and scikit-learn for the library that implements it.

The inspected examples below cover data inspection and split hygiene rather than training this model. What breaks when the method is misunderstood is the reading of its output. A score near 1 from predict_proba is not automatically a calibrated chance, and a high accuracy figure means little if test rows leaked into training. Before you accept an agent's result, ask for the held-out score and check the split with a leakage check. A sensible next action is to compare it with a second method on the same split.

Common confusions

  • Naive versus wrong. The independence assumption is often violated in real-world data, as IBM says, yet the scikit-learn guide still calls the method a decent classifier. Classification can work well despite this violation, while probability estimates may be poor.
  • Classifier versus probability estimator. The predicted class can be useful while the reported probabilities are not. Do not assume calibration; when the conditional-independence and distribution assumptions hold and probabilities are correctly estimated, its probabilities can be correct.
  • Naive Bayes versus Bayesian statistics. It uses Bayes' theorem, but it is a specific supervised algorithm with a fixed independence assumption, not a general Bayesian approach.
  • Naive Bayes versus a large language model. See Large language model for comparison. Naive Bayes treats each feature as independent given the class.

More in AI concepts

Next steps

  1. split-leakage-check A skill that exercises it.
  2. Classification Related term.
  3. scikit-learn Related term.
  4. All glossary terms A to Z and by family.

Sources

Definitions are written by Skill Almanac from these sources and were checked against them on 2026-11-25. Wikipedia is never the only source.

Review record

Last verified

Drafted by claude-sonnet-5-5; OpenAI Codex bounded factual repairs; sources and example targets checked by Independent automated source review (OpenAI Codex); not human peer review on 2026-11-25. Last verified .

Change log (5)
  • : Independent automated factual/example review completed. Cached US query estimate aligned to receipt; no traffic promise. Final technical gate recorded separately; publication disabled.
  • : First version.
  • : Verifier pass: applied wording corrections from the verification list.
  • : Bounded source repairs: Replaced raw-count multiplication with smoothed likelihoods and class priors; qualified calibration and scoped inspected examples. Pending independent re-review.
  • : Automated review completed; approved for the staged public release. Search indexing is controlled by the release configuration.