Non Parametric Algorithms
As we have seen with the QDA and LDA classifiers, it is possible to obtain the posterior probabilities by estimating the class conditional probabilities using a (multivariate) Gaussian distribution. And we estimated the parameters of the Gaussian distribution, $\mu$ and $\Sigma$ based on set of (unbiased) examples.
Instead of using this parametric approach, it is also possible to estimate the class conditional probabilities using Kernel density estimation
Kernel density estimation: Here the main idea is that you approximate the distribution by a mixture of continuous distributions called kernels.
Histogram Density Estimation
In histogram density estimation the feature space is split in subregions (kernels) of width: $h$. Within each of these regions the number of objects of each class is counted. The class conditional probabilties are then calculated per region, and normalized by the kernel width and total amount of samples.
The downside of the histogram method is that the feature space is discretely separated in bins. Therefore the estimated density will not be continuous throughout the feature space. Decreasing the bin size on the other hand causes problems in sparse datasets.
Parzen Density Estimation
In parzen density estimation, kernels are centered at every datatpoint $x_i$. The class conditional probability is the normalized sum of these kernels.
Given that the kernel used is wide enough and continuous, this method deals with the problems found in the histogram density estimation.
K-NN
Another method estimates the density of the distribution based on each data point $x$ his $k$ nearest neighbors. The metric for the density is based on the volume of a sphere $V_k$ centered at $x$ ,with radius $r$ being the distance to the $k^{th}$ nearest neighbor. This is divided by $n_i$ to normalize the density.
The general hypothesis function for the two class case is as follows:
The data distribution is similar to the class distribution, only non-class dependent:
Class priors are given by:
The class posteriors can be simplified, by removing non class dependant constants and multipliers.
This basically says that $x$ will be assigned to the class for which the euclidean distance to it’s $k^{th}$ nearest neighbor is smallest. Plugging the result in the (bernouilli) hypothesis function yields:
It is good to note that, unlike the gaussian function used in the parametric density estimations, the probability estimated using knn, parzen or histogram methods are improper. This means their area does not integrate to one for $-\infty$ to $+\infty$. Since we are only interested in the relations of order for our hypothesis function, this does not matter. https://tex.stackexchange.com/questions/133932/how-do-i-type-the-infinity-symbol-in-mactex/133935