Formula Used
The empirical prior uses observed class frequencies. Smoothing protects classes with few or zero samples. Bayesian updating combines each prior with supplied evidence.
How to Use the Calculator
- Select an empirical, uniform, custom, or smoothed method.
- Add every class and enter its observation count.
- Provide custom priors only when custom mode is selected.
- Enter likelihood values to calculate posterior probabilities.
- Choose automatic or manual evidence probability handling.
- Calculate, review warnings, compare charts, and export results.
Example Data
| Class | Observations | Empirical prior | Likelihood |
|---|---|---|---|
| Positive | 300 | 0.60 | 0.80 |
| Negative | 200 | 0.40 | 0.25 |
| Total | 500 | 1.00 | — |
Frequently Asked Questions
What is prior probability?
Prior probability describes belief before new evidence appears. It may use frequencies or expert assumptions. The value becomes input for later Bayesian updating.
When should I use empirical priors?
Use empirical priors when historical labels represent deployment conditions. They reflect observed class proportions directly. Review sampling bias before trusting their practical meaning.
What does a uniform prior mean?
A uniform prior gives every class equal probability. It ignores observed class frequency differences. This choice suits limited or deliberately neutral information.
Why use Laplace smoothing?
Laplace smoothing adds pseudo-counts to every class. It prevents exact zero prior probabilities. This improves stability when some classes appear rarely.
What is the Jeffreys prior?
The Jeffreys option uses one-half as pseudo-count. It is weaker than standard Laplace smoothing. The method often reduces stronger uniform assumptions.
Must custom priors sum to one?
Valid class priors normally sum exactly to one. Small rounding differences may still occur. Automatic normalisation converts positive values into valid proportions.
How is class imbalance measured?
The calculator compares largest and smallest positive counts. Larger ratios indicate stronger class imbalance. Zero-count classes require smoothing or additional training data.
How are posterior probabilities calculated?
Each prior is multiplied by its likelihood. Automatic evidence sums those weighted likelihoods. Dividing each numerator produces updated posterior probabilities.
What does prior entropy show?
Entropy measures uncertainty across the prior distribution. Higher values indicate more evenly distributed probabilities. Lower values indicate concentration within fewer classes.