Bayes' Theorem for Machine Learning: Priors, Posteriors, and Naive Bayes
Priors, likelihoods, and posteriors with worked examples, plus the independence assumption, smoothing, and log-probabilities behind Naive Bayes.
Bayes' theorem is a rule for learning from evidence. It begins with what is believed before new data arrives, measures how compatible the data is with each possible explanation, and produces an updated belief. This simple pattern supports medical diagnosis, spam filtering, document classification, risk assessment, scientific inference, and many other machine-learning tasks. The arithmetic is compact, but using it well requires careful thought about priors, likelihoods, assumptions, and the difference between a probability model and a confident-sounding number.
Bayes' Theorem for Machine Learning: Priors, Posteriors, and Naive Bayes
Bayesian reasoning provides a disciplined answer to a common question: after observing some evidence, how should a rational estimate change? The answer is not to discard everything known before the observation, and it is not to trust the new observation without qualification. Instead, Bayes' theorem combines prior information with the evidential strength of the new data.
In machine learning, the possible explanations are often class labels or parameter values. A classifier might ask whether a message is spam, whether a transaction is fraudulent, or which species produced an observed measurement. A parameter-estimation procedure might ask which value of a mean, rate, or regression coefficient is most plausible. In both cases, Bayesian reasoning turns assumptions and observations into conditional probabilities.
Updating beliefs with data
Suppose a factory produces components on two machines. Machine A produces most of the components and has a low defect rate. Machine B produces fewer components and has a higher defect rate. When a defective component is found, the relevant question is not merely, “Which machine has the higher defect rate?” Production volume matters too. A machine that rarely makes components may still be an unlikely source of a randomly selected defect.
This example contains the basic Bayesian structure:
- A hypothesis describes a possible explanation, such as “the component came from Machine A.”
- A prior probability records how plausible the hypothesis was before inspecting the component.
- A likelihood records how probable the observed evidence would be if the hypothesis were true.
- A posterior probability records how plausible the hypothesis is after accounting for the evidence.
Updating does not mean replacing a prior with a likelihood. Those probabilities answer different questions. The prior concerns the hypothesis before seeing the current evidence. The likelihood concerns the probability of the evidence under an assumed hypothesis. The posterior reverses the condition: it concerns the hypothesis after observing the evidence.
The distinction between and is one of the most important in probability. A test may detect a disease in 99% of people who have it, so . That does not imply that 99% of people with a positive result have the disease. The latter probability, , also depends on how common the disease is and how often healthy people test positive.
Bayesian learning is sequential. After one observation, the posterior can serve as the prior for the next update. If and are observations, then
When observations are conditionally independent given , this simplifies to
This repeated-update interpretation is valuable in online systems. A fraud model, for example, can revise risk as each new event in a transaction sequence arrives. The general principle remains the same: begin with a current state of knowledge, weigh new evidence under competing explanations, and normalize.
Deriving Bayes' theorem
Bayes' theorem follows directly from the definition of conditional probability. For events and with nonzero probability,
and
Because and are the same joint event,
Substituting this expression into the first definition gives Bayes' theorem:
The denominator can be expanded when the hypotheses are mutually exclusive and collectively exhaustive. The law of total probability gives
Therefore, for class ,
This form is especially useful for classification. It computes a score for every possible class and divides each score by their sum. The normalized posteriors then add to one.
The four terms and what they mean
The terminology is easiest to understand by keeping the conditioning direction visible.
| Term | Symbol | Question answered | Role in an update |
|---|---|---|---|
| Prior | How plausible was the hypothesis before this evidence? | Represents base rates or previous knowledge | |
| Likelihood | How expected is this evidence if the hypothesis is true? | Measures evidential compatibility | |
| Evidence | How probable is the evidence across all hypotheses? | Normalizes posterior probabilities | |
| Posterior | How plausible is the hypothesis after seeing the evidence? | Becomes the updated belief |
The numerator is sometimes called the unnormalized posterior. When the goal is only to choose the most probable class, the evidence term may be omitted because it is identical for every class:
Omitting the denominator is valid for ranking hypotheses for the same observation. It is not valid when calibrated posterior probabilities are needed, when observations with different evidence terms are being compared, or when the actual probability value must be reported.
Likelihood is not a probability distribution over hypotheses
As a function of the evidence, is a conditional probability distribution. During parameter estimation, however, the observed data is fixed and the likelihood is treated as a function of the unknown hypothesis or parameter. Its values do not generally sum or integrate to one over hypotheses.
For example, if a coin yields eight heads in ten tosses, both a head probability of and one of can assign substantial likelihood to the observation. Those likelihood values describe how well each parameter explains the fixed data. They are not posterior probabilities until multiplied by a prior and normalized.
This careful language prevents a common error: saying that a parameter has “an 80% likelihood.” A likelihood requires an explicit data model and observed data. A posterior probability, under a specified prior and model, is what quantifies uncertainty about the parameter.
Worked medical-test example
Consider a condition affecting 1% of a population. A test has 95% sensitivity, meaning that it is positive for 95% of people who have the condition. Its specificity is 90%, meaning that it is negative for 90% of people who do not have the condition.
Define:
The last value is the false-positive rate, equal to one minus specificity. We want , the probability of the condition after a positive result.
First compute the total probability of a positive result:
Bayes' theorem now gives
Thus, the posterior probability is about 8.76%, not 95%. The result is not a contradiction. Sensitivity answers how often the test is positive among people who have the condition. The posterior answers how often the condition is present among people with a positive test. Because the condition is rare, the much larger healthy population generates many false positives even though each healthy person has only a 10% false-positive probability.
A natural-frequency interpretation makes the calculation tangible. Imagine 10,000 people. About 100 have the condition; approximately 95 of them test positive. About 9,900 do not have it; approximately 990 of them test positive. There are therefore about 1,085 positive results, of which 95 are true positives:
The prior probability has increased from 1% to 8.76%, so the result is meaningful evidence. It is simply not conclusive evidence. This distinction matters whenever a model handles rare events, including fraud detection, fault monitoring, and security alerts.
If a second conditionally independent test with the same performance is positive, the first posterior can be used as the new prior. The resulting probability increases substantially. In practice, repeated medical tests may not be conditionally independent: they can share equipment, biological mechanisms, or systematic errors. Bayesian arithmetic cannot repair a false independence assumption.
A machine-learning classification example
Suppose an email classifier has two classes: spam and legitimate mail . In the training population, 30% of messages are spam:
Consider a message containing the words “winner” and “meeting.” From training counts, suppose the model estimates
A Naive Bayes model assumes the observed features are conditionally independent given the class. Under that assumption, the unnormalized class scores are
The word “meeting” favors legitimate mail, while “winner” strongly favors spam. The scores combine both signals with the class priors. Normalization produces
and
The model predicts spam. Notice that the prior favored legitimate mail, but the likelihood ratio supplied enough evidence to overcome it. Posterior odds make this relationship particularly clear:
The posterior odds equal the prior odds multiplied by a likelihood ratio. Each feature contributes evidence for one class relative to another. This odds view is useful because it separates baseline prevalence from the information contained in the observed features.
The calculation also reveals a caution. If “winner” and another feature such as “prize winner” occur together for nearly the same linguistic reason, treating them as independent can count one signal twice. The prediction may remain correct, but its reported confidence can be excessive.
From Bayes' theorem to Naive Bayes
For a feature vector and class , Bayes' theorem gives
The hard part is estimating the joint class-conditional distribution . With many features, the number of possible combinations grows rapidly. If 20 features are binary, there are possible feature vectors. A finite training set will contain few or no examples of most combinations.
Naive Bayes makes a simplifying assumption:
In words, features are assumed to be mutually independent after the class is known. This is conditional independence, not ordinary independence. Two words may be associated in the full email population because both are common in spam. The model requires that, within a fixed class, knowing one feature provides no additional information about another.
The resulting classifier is
The assumption is rarely exactly true, especially for language, images, and measurements produced by shared physical mechanisms. Nevertheless, Naive Bayes can classify well. Classification only requires the correct class to receive the greatest score; the entire joint distribution need not be perfectly modeled. Errors in probability estimates may partially cancel, and strong individual features can still define a useful decision boundary.
Naive Bayes has practical advantages. Training is fast because it primarily estimates class frequencies and per-feature statistics. Prediction is also fast. The model works naturally with high-dimensional sparse data, often performs well with relatively little training data, and provides a transparent baseline. Its probability estimates, however, should not automatically be treated as calibrated confidence values.
Gaussian, multinomial, and Bernoulli Naive Bayes
“Naive Bayes” describes a family of models. The independence assumption is shared, but the distribution chosen for each feature depends on what the feature represents.
Gaussian Naive Bayes
Gaussian Naive Bayes is designed for continuous measurements such as height, temperature, sensor voltage, or standardized laboratory values. For each class and feature , it estimates a mean and variance :
The model does not require every feature to have the same mean or variance. It estimates separate parameters by class and feature. It does assume that each feature's distribution within a class is reasonably approximated by a normal curve and that features are conditionally independent.
Gaussian Naive Bayes can be effective when each class forms an approximately axis-aligned cloud in feature space. Strong skew, heavy tails, outliers, or correlated measurements can weaken the model. Transformations, robust preprocessing, or a different classifier may then be more suitable.
Multinomial Naive Bayes
Multinomial Naive Bayes is commonly used for counts, especially word counts in documents. If is the number of times token occurs and is the token probability for class , the class-conditional model is proportional to
Longer documents contain more total counts, and repeated occurrences can strengthen evidence. Term-frequency features are natural inputs. Nonnegative transformed values such as TF-IDF are also frequently used in practice, although they no longer correspond exactly to literal multinomial counts.
The model estimates from token counts in each class, usually with smoothing. It is a strong baseline for topic classification, sentiment classification, spam detection, and routing support requests.
Bernoulli Naive Bayes
Bernoulli Naive Bayes models binary features. In text classification, a feature records whether a word appears, not how often it appears. Its class-conditional contribution includes both presence and absence:
This distinction can matter. Multinomial Naive Bayes treats three occurrences as stronger evidence than one. Bernoulli Naive Bayes treats both as “present,” while also using the absence of expected terms as evidence.
Choose Gaussian Naive Bayes for continuous features with approximately normal within-class distributions, multinomial Naive Bayes for nonnegative counts or frequency-like features, and Bernoulli Naive Bayes for binary indicators. The model should match the data-generating interpretation rather than being selected only by habit. Cross-validation can then compare plausible variants on the actual prediction objective.
Log-probabilities and numerical stability
Naive Bayes multiplies many probabilities. Because each factor is usually between zero and one, the product can become extremely small. In floating-point arithmetic, a sufficiently small value underflows to zero. If several class scores all become zero, their relative ordering is lost.
Logarithms turn products into sums:
For classification, the evidence term can again be omitted because it is common to all classes:
The logarithm is strictly increasing, so it does not change which positive score is largest. It only changes how the score is represented. Summing moderate negative values is much safer than multiplying hundreds of tiny positive values.
When normalized probabilities are required, use the log-sum-exp identity. If is the unnormalized log-score for class , then
Subtracting the maximum keeps exponentials in a representable range. The posterior log-probability is
The following implementation illustrates log scoring for multinomial Naive Bayes. It assumes smoothed log token probabilities and log class priors have already been learned.
import math
def logsumexp(values):
maximum = max(values)
return maximum + math.log(sum(math.exp(value - maximum) for value in values))
def predict_multinomial(counts, class_log_priors, feature_log_probs):
log_scores = []
for class_index, log_prior in enumerate(class_log_priors):
score = log_prior
for count, log_probability in zip(
counts, feature_log_probs[class_index]
):
score += count * log_probability
log_scores.append(score)
normalizer = logsumexp(log_scores)
probabilities = [
math.exp(score - normalizer) for score in log_scores
]
predicted_class = max(
range(len(log_scores)), key=log_scores.__getitem__
)
return predicted_class, probabilities
Production libraries use vectorized arithmetic and include safeguards for edge cases, but the logic is the same: accumulate evidence in log space, compare log-scores, and normalize stably only when probabilities are needed.
Maximum likelihood and maximum a posteriori estimation
Bayes' theorem is also used to estimate model parameters. Let denote an unknown parameter and the observed dataset:
Maximum likelihood estimation, or MLE, chooses the parameter that makes the observed data most probable:
Maximum a posteriori estimation, or MAP, chooses the parameter with the greatest posterior density:
The evidence does not depend on , so it does not affect the maximizing value. The difference is the prior. MLE relies only on the likelihood, while MAP balances data fit with prior preference.
Consider a coin observed to land heads once in one toss. The MLE for the head probability is . This estimate fits the tiny dataset perfectly but is extreme. A prior concentrated around ordinary, non-extreme coins pulls the MAP estimate away from one. As the number of observations grows, the likelihood generally becomes more concentrated and the influence of a fixed, reasonable prior decreases.
MAP produces a point estimate, not the full Bayesian result. A complete Bayesian analysis retains the posterior distribution, allowing predictions to average over parameter uncertainty:
This posterior predictive distribution can express uncertainty that a single MLE or MAP estimate hides.
Regularization has a Bayesian interpretation. Maximizing a log-posterior gives
A Gaussian prior on coefficients leads to an -type penalty, while a Laplace prior leads to an -type penalty. This connection does not make every use of regularization a complete Bayesian analysis, but it explains how a prior can encode preference for smaller or sparser parameters.
Bayesian and frequentist intuition
Bayesian and frequentist methods use the same probability laws but interpret uncertainty differently. An accessible comparison begins with what is treated as uncertain.
In a frequentist model, an unknown parameter such as a population mean is fixed, even though its value is not known. The data is random because a repeated sampling process could have produced different samples. A 95% confidence-interval procedure is designed so that, over many repetitions, 95% of the intervals it constructs contain the fixed true parameter. Once one interval has been calculated, traditional frequentist language does not assign a 95% probability to that fixed parameter being inside it.
In a Bayesian model, uncertainty about the parameter is represented with a probability distribution. Before data, that distribution is the prior. After data, it is the posterior. A 95% credible interval can be interpreted, under the assumed model and prior, as containing 95% of the posterior probability.
Neither framework removes the need for judgment. Frequentist analysis requires choices about sampling models, estimators, test statistics, and stopping rules. Bayesian analysis requires those choices plus a prior. Both can be rigorous, and both can be misused. In many standard problems, they produce similar numerical answers when the dataset is large and the prior is weak relative to the likelihood.
The frameworks emphasize different questions. Frequentist procedures often focus on long-run error control: how often will this method make a false discovery or miss the true value across repeated studies? Bayesian procedures focus on conditional uncertainty: given this model, prior information, and observed data, what should be believed now?
Machine learning uses ideas from both traditions. Maximum likelihood, cross-validation, bootstrap uncertainty, Bayesian parameter inference, MAP regularization, and posterior predictive checks can coexist in one workflow. The useful question is not which label wins, but which assumptions and guarantees fit the decision being made.
Failure modes and practical safeguards
Bayes' theorem itself is an identity, so it does not fail mathematically when its inputs are valid. Applications fail because priors, likelihood models, independence assumptions, or data are unsuitable. Understanding these failure modes is essential.
Correlated features
Naive Bayes can count correlated evidence more than once. In a medical model, “high systolic pressure” and “hypertension diagnosis” may largely describe the same phenomenon. In a text model, “limited offer” and “limited-time offer” may overlap. Multiplying their individual likelihoods as though they were conditionally independent can produce overconfident posteriors.
Possible responses include removing redundant features, combining related features, using dimensionality reduction, or selecting a model that captures dependencies. Logistic regression, tree-based models, and richer probabilistic graphical models are alternatives. Whether correlation harms class accuracy must be tested; a violated assumption can distort probabilities strongly while leaving the class ranking surprisingly useful.
Zero counts
Suppose a vocabulary word never appears in the training documents of one class. Its estimated class-conditional probability by raw relative frequency is zero. Because Naive Bayes multiplies feature probabilities, one zero makes the entire class score zero, regardless of all other evidence.
This is too strong a conclusion from finite data. Absence in a training sample does not prove impossibility in the population. It only means the event was not observed.
Laplace and additive smoothing
Laplace smoothing adds one pseudo-count to every possible category. For token in class ,
where is the count of token in class , is the total token count for that class, and is vocabulary size. Every token receives nonzero probability, and the denominator preserves normalization.
More generally, additive smoothing uses :
The hyperparameter controls smoothing strength. Very small values stay close to observed relative frequencies; larger values pull probabilities toward a uniform distribution. Laplace smoothing is the special case . Cross-validation can help select , and its effect should be understood relative to dataset size and vocabulary size.
Poor priors and changing base rates
A prior based on yesterday's prevalence may be wrong tomorrow. Spam rates, fraud rates, equipment-failure rates, and customer behavior can shift. Because posterior probabilities depend directly on class priors, a classifier deployed under a changed class balance can become miscalibrated even if class-conditional feature patterns remain stable.
Monitor prevalence and calibration after deployment. If the likelihood model remains valid, adjusting priors may help. If feature distributions also change, retraining or redesign may be necessary. A prior should represent relevant knowledge for the population and time at which predictions are made.
Model misspecification and bad data
Gaussian Naive Bayes may fit poorly when features are highly skewed or multimodal within each class. Multinomial assumptions may be inappropriate for arbitrary signed values. Missing values, measurement error, mislabeled examples, and selection bias can all corrupt probability estimates.
More data does not automatically cure a misspecified model. With enough data, an incorrect likelihood can become very confidently incorrect. Examine distributions, validate on representative held-out data, compare baselines, and test calibration rather than relying only on training accuracy.
Overconfident probability estimates
Naive Bayes often produces posterior scores near zero or one because many feature contributions are multiplied and dependencies are ignored. These scores can rank examples well without matching observed frequencies. If probability quality matters—for triage thresholds, expected-cost decisions, or human-facing risk estimates—evaluate reliability diagrams, log loss, and Brier score. Calibration methods such as isotonic regression or sigmoid calibration may help when fitted on separate validation data.
Leakage
Bayesian formulas do not protect against target leakage. A document feature added after moderation, a diagnostic code recorded after disease confirmation, or a transaction status assigned after fraud investigation can make evaluation look excellent while being unavailable at prediction time. Define the prediction timestamp, build features only from information available then, and split data in a way that respects groups and time.
Practice with Solver360
The best way to make Bayes' theorem intuitive is to calculate several updates and change one assumption at a time. Use the Naive Bayes Calculator to explore class priors, feature likelihoods, and posterior class scores. Begin with two classes and two features so every factor remains visible.
Try the spam example from this article. Then make spam rarer by reducing its prior while keeping the feature likelihoods fixed. Observe how much stronger the words must be to overcome the new base rate. Next, hold the priors fixed and make “winner” common in legitimate messages. The likelihood ratio shrinks, so the posterior should move toward legitimate mail.
You can also create a zero-count case. Assign one feature probability of zero and inspect how it eliminates a class. Then apply additive smoothing and verify that the class can again receive a nonzero score. This experiment demonstrates why smoothing is a modeling necessity rather than a cosmetic numerical trick.
The Statistics Calculator can support the surrounding probability work. Use it to summarize continuous variables before considering Gaussian Naive Bayes. Compare class-specific means, variances, and distributions. If a feature is highly skewed or contains extreme outliers, ask whether a Gaussian density is defensible and whether transformation or another model would better match the data.
A productive practice sequence is:
- Write down the hypothesis and evidence in words.
- Label every probability with its conditioning direction.
- Calculate the unnormalized posterior for every hypothesis.
- Sum the scores to obtain the evidence.
- Normalize and check that the posteriors sum to one.
- Interpret the result relative to the prior, not in isolation.
- Change one prior or likelihood and explain the direction of the result before recalculating.
- Repeat in log space and confirm that the predicted class is unchanged.
This sequence turns formulas into a reasoning habit. It also exposes mistakes early. If posterior probabilities do not sum to one, if a likelihood has been reversed, or if a rare class suddenly dominates without strong evidence, the written steps show where to investigate.
A compact workflow for Bayesian classification
For a new classification problem, first define classes that are mutually exclusive and meaningful for the decision. Estimate class priors from representative data or defensible domain knowledge. Then select a feature model that matches the feature type: Gaussian for continuous measurements, multinomial for counts, or Bernoulli for binary indicators.
Split the data before fitting preprocessing choices to avoid leakage. Estimate class-conditional parameters on the training set, using smoothing where relevant. Compute predictions in log space. Evaluate not only accuracy but also metrics suited to class imbalance and decision cost, such as precision, recall, area under the precision-recall curve, log loss, and calibration.
Inspect errors by subgroup and over time. Check whether correlated features create brittle confidence, whether rare feature values receive unreasonable probabilities, and whether base rates shift in deployment. Compare against a simple alternative such as logistic regression. A more complex model should earn its complexity through reliable validation gains, while a Naive Bayes baseline can remain valuable for speed and interpretability.
Finally, document the model's probability semantics. State whether outputs are raw Naive Bayes posteriors, calibrated probabilities, or only ranking scores. A numerical value such as 0.97 appears precise, but its usefulness depends on model fit, representative data, and calibration.
Frequently asked questions
Why is Bayes' theorem useful in machine learning?
It connects observed features to unknown classes or parameters while explicitly accounting for prior probabilities. This makes base rates visible and provides a coherent rule for updating uncertainty. It also leads directly to practical classifiers, parameter estimators, and posterior predictive distributions.
What is the difference between a prior and a posterior?
A prior represents uncertainty before incorporating the current data. A posterior represents uncertainty after combining that prior with the likelihood of the observed data. In sequential learning, today's posterior can become tomorrow's prior when genuinely new evidence arrives.
Is a likelihood the same as a probability?
A likelihood is built from a probability model, but its interpretation differs. With a fixed hypothesis, is the probability of data. With observed data held fixed and varied, the same expression is a likelihood function over hypotheses. It need not sum to one across hypotheses and is not a posterior probability.
Why is Naive Bayes called naive?
It assumes features are conditionally independent given the class. Real features frequently interact or share causes, so the assumption is deliberately simple. The name describes the assumption, not necessarily the classifier's performance. It can remain highly competitive for sparse, high-dimensional data.
Does Naive Bayes require normally distributed features?
Only Gaussian Naive Bayes uses a normal density for continuous features. Multinomial Naive Bayes models counts or nonnegative frequency-like values, while Bernoulli Naive Bayes models binary indicators. The chosen variant should match the feature representation.
Why use logarithms if they do not change the prediction?
Direct products of many small probabilities can underflow to zero in floating-point arithmetic. Logarithms convert multiplication into addition, preserving relative scores over a much wider numerical range. They also make each feature's additive contribution easier to inspect.
What happens when a feature was never observed in one class?
An unsmoothed frequency estimate becomes zero, which makes the entire class likelihood zero when that feature appears. Additive smoothing assigns a small nonzero probability to unseen events. Laplace smoothing uses a pseudo-count of one, while a general smoothing parameter allows weaker or stronger shrinkage.
How are MAP and MLE different?
MLE chooses the parameter that maximizes the likelihood of observed data. MAP chooses the parameter that maximizes likelihood times prior. With a uniform prior they can coincide. With limited data or an informative prior they can differ substantially. Both produce point estimates; full Bayesian inference retains a posterior distribution.
Can a Naive Bayes posterior be trusted as a calibrated probability?
Not automatically. Independence violations can make raw probabilities too extreme even when classification accuracy is good. Calibration should be measured on representative held-out data. If decisions depend on probability magnitude, use appropriate calibration metrics and, when justified, a separately fitted calibration method.
How should priors be chosen?
Class-frequency estimates from representative training data are a common starting point. Domain knowledge may justify different priors, especially when sampling has altered prevalence. Priors should be documented, sensitivity-tested, and updated when deployment base rates change.
Can Bayes' theorem prove that a hypothesis is true?
No. It computes probabilities conditional on the hypotheses, model, prior, and data under consideration. An omitted explanation, biased sample, inaccurate likelihood, or poor measurement process can produce a misleading posterior. Bayesian results are conditional conclusions, not guarantees independent of assumptions.
When should another classifier be preferred?
Consider alternatives when interactions and correlated features carry essential information, when class-conditional distributions are poorly represented by available Naive Bayes variants, or when calibrated probabilities remain inadequate. Logistic regression, tree ensembles, support vector machines, and neural networks offer different tradeoffs. Validation on the intended deployment distribution should guide the choice.
What to learn next
Bayes' theorem is easier to use when the underlying probability rules are fluent. The next probability article should develop random variables, conditional probability, independence, expectation, common distributions, and the law of total probability. Those concepts explain where priors and likelihoods come from and how uncertainty propagates through a model.
After that foundation, continue to the logistic regression and softmax article. Binary logistic regression models log-odds directly, while softmax regression extends the idea to multiple classes. Comparing their discriminative approach with the generative approach of Naive Bayes clarifies why both can produce posterior-like class probabilities while learning different quantities and making different assumptions.
The lasting lesson is that evidence has meaning only relative to alternatives and base rates. Bayes' theorem formalizes that lesson: multiply prior plausibility by evidential compatibility, normalize across explanations, and revise conclusions as new data arrives. Naive Bayes turns the same principle into a fast classifier by simplifying the feature distribution. Its assumptions should be tested rather than hidden, its arithmetic should be performed in log space, and its probabilities should be checked against reality. Used with that discipline, Bayesian reasoning is not merely a formula; it is a practical framework for learning under uncertainty.
Continue reading
Probability for Artificial Intelligence: Random Variables, Distributions, and Likelihood
A practical probability toolkit for AI: conditional probability, common distributions, likelihood, and maximum likelihood estimation.
Sigmoid, Softmax, and the Mathematics of Classification
Turn raw scores into probabilities: sigmoid, logits, softmax, temperature, log-sum-exp stability, and the last-layer math of classifiers.