A discriminant function gives a score for each class . The classifier picks the class with the largest score. This is the practical form of the MAP Decision Rule.
Main idea
$g_i(\mathbf{x})=\ln p(\mathbf{x}|\omega_i)+\ln p(\omega_i)$. Decide the class with the largest $g_i(\mathbf{x})$. The boundary between class $i$ and class $j$ is $g_i(\mathbf{x})=g_j(\mathbf{x})$.
From MAP to Discriminant Functions
The Bayesian (optimal) classification maximises the posterior probability and so minimises the classification error:
Since:
and is not a function of , the classifier only needs to evaluate:
and find the class with the maximum value of for a given pattern .
Why take the natural logarithm:
- is monotonically increasing, so it does not change which class is the largest
- it simplifies the evaluation when is an exponential function, such as a Gaussian
flowchart LR X["Pattern x"] --> G1["g1(x)"] X --> G2["g2(x)"] X --> Gc["gc(x)"] G1 --> M["Select the<br/>maximum"] G2 --> M Gc --> M M --> D["Decide ωk"]
Multivariate Gaussian Class-Conditional PDF
Let in dimensions:
Take and add . The discriminant function becomes a quadratic function of :
where:
- is the square of the Mahalanobis distance
- the term is the same for all classes, so it is dropped
So the classifier prefers the class whose mean is closest in Mahalanobis distance, adjusted by the bias .
Decision Boundary
The decision boundary between class and class is where the two scores are equal:
The shape of this boundary depends on the covariance matrices:
| Covariance | Boundary | Note | |
|---|---|---|---|
| Different | quadratic in | hyperquadric | Quadratic Classifier |
| Same | linear in | hyperplane | Linear Classifier |
| Same | linear in | hyperplane orthogonal to the line of means | Minimum Distance Classifier (equal priors) |