Classification uses a function $f$ (called a classifier) to map input $x$ to class $y$.
$y = f (x) : f$ takes in $x ∈ X$ and declares its class to be $y ∈ Y$
The problem is two-fold:
Classify to class 1 when: $p(y_1|x)>p(y_2|x)$.
May be easier to estimate the class-conditional probability density: $\hat{p}(x|y_1),\ \hat{p}(x|y_2)$.
Use Bayes’ rule to transform one into the other:
$$ p(y|x)=\frac{p(x|y)p(y)}{p(x)} $$
Putting just the direct estimate, $\hat{p}(x|y)$, in results in plug-in Bayes rule.
So, for Bayes rule we need to estimate:
So, given a training set: