Classification
- Model
- p(c)p(x|c)
- Evidence
- features x
- Eliminate
- score or normalize over classes
- Output
- posterior or cost-sensitive decision
Factor the joint law. Insert evidence. Eliminate what is hidden. Then answer the question you actually asked.
Why can one model produce a class label, a prediction with uncertainty, a hidden-state marginal, or a globally most likely path?
A joint distribution is a declarative model. Inference compiles it into a computation by exploiting factorization and choosing what to eliminate.
Distributivity lets both computations reuse local messages. The elimination operator determines what the answer means.
Do not swap the objective after the fact. Per-time marginal modes can have lower pointwise error yet fail to be the joint MAP path. Viterbi optimizes joint path probability; it does not promise minimum error at every time step.
These guardrails are reconstructed lessons, not claims that the historical lab code passed them.
Long products underflow. Add log factors and use log-sum-exp where sums remain.
Use Cholesky or stable linear solves for Gaussian updates and discriminants.
If the future depends on finite history, include that history in the state.
Missing evidence contributes one; impossible evidence contributes zero.
Brute-force a small model to oracle-check marginals, normalization, and MAP paths.