Paper commentary
Estimating Continuous Distributions in Bayesian Classifiers
Kernel density estimates replace Gaussians in naive Bayes classifiers
- Problem Naive Bayes fits each numeric attribute in each class with one Gaussian, so every class-conditional density gets a bell shape even when the data are not normal. Discretizing the values was the other common fix.
- Method FLEXIBLE BAYES keeps independence but replaces each Gaussian with a kernel density estimate.
- Results On 11 databases under ten-fold cross validation, FLEXIBLE BAYES was significantly more accurate than NAIVE BAYES on five and significantly less accurate on two. On a mixture of two Gaussians, it reached 99.0% accuracy with 200 training instances.
Where the Gaussian assumption enters
The naive Bayesian classifier models each numeric attribute within a class as a single Gaussian, so every class-conditional density takes a bell shape whether or not the data do. The authors note that a Gaussian is often a reasonable approximation to real distributions but is not always the best one, which makes the density estimator a natural place to change the model.
The change they make is deliberately narrow: the independence assumption stays in place, and only the estimation of each continuous density is replaced.
From a single Gaussian to kernel estimates
Classification applies Bayes' rule to each class. Under conditional independence the joint likelihood of a test case factors into a product of per-attribute likelihoods, and the denominator is dropped because normalizing over classes removes it. \[p(X=x \mid C=c)=\prod_i p(X_i=x_i \mid C=c)\]
FLEXIBLE BAYES keeps this product and changes only the factor for a continuous attribute: the density becomes an average of Gaussian kernels, one centred on each training value of that attribute in that class. Nominal attributes are still handled by sample frequencies, so the change touches only the numeric part of the model.
The cost of this is storage and computation. NAIVE BAYES keeps only the sum and sum of squares of each class's values, whereas FLEXIBLE BAYES must keep every continuous value it sees, and at test time it evaluates one kernel per stored value. In the authors' complexity summary, training space rises from O(k) to O(nk), and test time for m cases rises from O(mk) to O(mnk).
The kernel width for class c is set from the number of training instances in that class, so the kernels narrow as more data arrive and the estimate becomes more local. The authors chose this rule over the rules of thumb in the statistical literature, since each of those rules carries assumptions about the density that hold only for some distributions.
Why the estimate should converge
The authors ask whether the class-posterior estimate is strongly pointwise consistent, meaning that the estimate converges almost surely to the true density at each point as the number of examples grows. Consistency of the posterior would mean that, in the limit, classification with this estimate reaches the Bayes optimal error rate.
The proof has three steps. For nominal attributes, sample frequencies converge by the strong law of large numbers, which is the content of Theorem 1. For continuous attributes the authors apply Devroye's conditions for kernel estimates: the kernel must be a nonnegative function that integrates to 1, the bandwidth must go to zero, and n times the bandwidth must go to infinity.
Gaussian kernels with the chosen bandwidth satisfy these conditions. A product lemma then shows that multiplying strongly consistent density estimates yields a strongly consistent estimate of the product, and a related quotient lemma covers the division by the marginal, so the posterior estimate is strongly consistent.
This is an asymptotic result that depends on the independence assumption holding, so it does not by itself describe accuracy at a fixed training size.
Natural data set results
The authors evaluated 11 databases from the UCI machine learning repository and elsewhere. Each algorithm was run with ten-fold cross validation, training on nine of the ten sets and testing on the remaining one, and the procedure was repeated so that every set served as the test set once. C4.5 was run the same way as a reference point.
FLEXIBLE BAYES was significantly more accurate than NAIVE BAYES on five of the 11 domains, significantly less accurate on two, and not significantly different on four, according to a paired t test. Table 2 reports the mean and standard deviation over the ten runs for each domain together with the C4.5 accuracy.
The two domains where NAIVE BAYES beat FLEXIBLE BAYES were both medical. The authors suggest that doctors may define diseases so that important continuous features are roughly normal given the disease status, which would favour a Gaussian model.
On Glass2 and Meta-Learning, NAIVE BAYES was significantly worse than C4.5, while FLEXIBLE BAYES was significantly better than C4.5 on those domains.
Rounding effects in blood pressure
In the Cleveland heart disease database, blood pressure values are often rounded to the nearest 10, which produces peaks at 120, 130 and 140, while other records are not rounded. The kernel estimate follows these spikes, whereas the single Gaussian smooths over them, so the kernel method is misled on this attribute.
The authors hypothesized that removing the blood pressure attribute would bring the two methods to comparable performance, and they tested this with a ten-fold cross validation run without that attribute.
Learning curves on controlled distributions
Natural data sets cannot isolate the effect of normality, so the authors state two hypotheses for learning curves. When normality holds, the two methods should reach the same asymptote, with NAIVE BAYES faster on small sets. When only independence holds, FLEXIBLE BAYES should reach the Bayes optimal error rate and NAIVE BAYES should not.
The authors defined joint distributions, drew training sets of varying size independently from them, and evaluated each model on a test set of 1000 instances from the same distribution. Ten independent samples were built for each training set size.
When the class-conditional distribution is a mixture of two Gaussians, NAIVE BAYES cannot represent its shape because its model is too simple, while FLEXIBLE BAYES reached 99.0% accuracy with a training set of 200 instances. Numerical integration gave a Bayes optimal error rate of 1.863% for this domain. The authors note that the reported accuracy seems to beat this bound, and they attribute the discrepancy to the 1000-instance test set, expecting that an order of magnitude more test instances would bring the error in line with the bound.
Relation to other approaches
Probabilistic neural networks estimate a joint density for each class with kernels and do not assume independence, so they need one multivariate estimate per class rather than one univariate estimate per attribute. Discretization methods convert continuous features into intervals before learning, and the authors cite a study reporting that a naive Bayesian classifier combined with discretization gave higher accuracy than C4.5 averaged over many domains.
The representational power of the flexible naive Bayesian classifier resembles that of Generalized Additive Models, and Geiger and Heckerman's Gaussian networks differ because their continuous variables are each estimated by a single Gaussian.
Limits and open questions
The consistency result is asymptotic and requires the independence assumption, and the finite-sample behaviour of the method is treated as an empirical question. The method stores every continuous training value, so its memory grows with the number of training cases and its test time grows with that number too.
The authors also mention borrowing an EM-based Gaussian mixture density approach as a further possibility.
Paper info
- Authors
- George H. John, Pat Langley
- Venue
- arXiv · Preprint
- First published
- 2013-2-20
- Added
- 2026-11-12
- Updated
- 2013-2-20
- Version
- v1
- arXiv
- 1302.4964
- Category
- cs.LG · cs.AI · stat.ML
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
George H. John, Pat Langley (2013). Estimating Continuous Distributions in Bayesian Classifiers. arXiv:1302.4964v1. https://arxiv.org/abs/1302.4964v1
BibTeX
@misc{john2013estimating,
title = {{Estimating Continuous Distributions in Bayesian Classifiers}},
author = {George H. John and Pat Langley},
year = {2013},
eprint = {1302.4964},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1302.4964v1}
}