← All notes

Naive Bayes classifiers assume features are independent given the class

Answer: Naive Bayes methods are supervised learning algorithms. They apply Bayes' theorem with a naive assumption: features are conditionally independent given the class.

What the assumption buys you

In spite of that over-simplified assumption, these classifiers have done well in practice, including document classification and spam filtering. They can estimate their parameters from only a little training data. They can also be extremely fast compared with more sophisticated methods, because each feature's class-conditional distribution is fit on its own as one dimension.

On the flip side, it can be a decent classifier and still be a bad estimator. Do not take predict_proba outputs too seriously.

Spark MLlib

Spark MLlib treats naive Bayes as a simple, probabilistic, multiclass classifier family. It applies Bayes' theorem and assumes strong independence between every pair of features. Training is very efficient. A single pass over the training data is enough to compute each feature's conditional probability distribution given each label.

MLlib supports Multinomial, Complement, Bernoulli, and Gaussian variants. Multinomial, Complement, and Bernoulli models are typically used for document classification. A feature's value may be the frequency of the term, or a zero or one.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: scikit-learn User Guide, Naive Bayes, BSD-3-Clause (https://raw.githubusercontent.com/scikit-learn/scikit-learn/main/COPYING). Copyright (c) 2007-2026 The scikit-learn developers. Apache Spark MLlib classification docs, Apache-2.0 (https://raw.githubusercontent.com/apache/spark/master/LICENSE). Copyright 2014 and onwards The Apache Software Foundation. NOTICE: https://raw.githubusercontent.com/apache/spark/master/NOTICE. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: scikit-learn User Guide, Naive Bayes, BSD-3-Clause (https://raw.githubusercontent.com/scikit-learn/scikit-learn/main/COPYING). Copyright (c) 2007-2026 The scikit-learn developers. Apache Spark MLlib classification docs, Apache-2.0 (https://raw.githubusercontent.com/apache/spark/master/LICENSE). Copyright 2014 and onwards The Apache Software Foundation. NOTICE: https://raw.githubusercontent.com/apache/spark/master/NOTICE.

Cite this

Permanent ID: iil:note:93hgz068

iinventedlight. 2026. "Naive Bayes classifiers assume features are independent given the class." iinventedlight Library, iil:note:93hgz068, version of 2026-11-16. https://iinventedlight.com/library/notes/naive-bayes/. License: CC-BY-4.0.

@misc{iil_note_93hgz068,
  author = {{iinventedlight}},
  title = {{Naive Bayes classifiers assume features are independent given the class}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-16},
  url = {https://iinventedlight.com/library/notes/naive-bayes/},
  note = {Permanent ID iil:note:93hgz068. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/naive-bayes.md.