Skip to content
Quantoros

Which distributions does GaussianNB fit: one Gaussian for the entire feature matrix or separate ones?

Classic MLLevel: IntermediateClass-specific feature distributions

Which distributions does GaussianNB fit: one Gaussian for the entire feature matrix or separate ones?

Hints
  • Index parameters by both class and feature.
  • Independence removes off-diagonal covariance terms.

Answer

Separate univariate Gaussian feature distributions for each class, using class-specific means and variances. The naive factorization omits arbitrary within-class feature covariance.

Source and licence: scikit-learn 1.7.2 — naive bayes · BSD-3-Clause · answer: Quantoros editorial

Related questions