Line 22: Line 22:
 
Let's consider a testing sample '''x'''. Based on labeled training sample '''D'''<math>^n</math> <math>= x_{1},... ,x_{n},</math> the nearest neighbor technique will find the closest point '''x'''' to '''x'''. Then we assign the class of '''x'''' to '''x'''. This is how the classification based on the nearest neighbor rule is processed. Although this rule is very simple, it is also reasonable. The label <math>\theta'</math> used in the nearest neighbor is random variable which means $\theta' = w_{i}$ is same as a posterior probability <math>P(w_{i}|x').</math> If sample sizes are big enough, it could be assumed that x' is sufficiently close to x that <math>P(w_{i}|x') = P(w_{i}|x).</math>
 
Let's consider a testing sample '''x'''. Based on labeled training sample '''D'''<math>^n</math> <math>= x_{1},... ,x_{n},</math> the nearest neighbor technique will find the closest point '''x'''' to '''x'''. Then we assign the class of '''x'''' to '''x'''. This is how the classification based on the nearest neighbor rule is processed. Although this rule is very simple, it is also reasonable. The label <math>\theta'</math> used in the nearest neighbor is random variable which means $\theta' = w_{i}$ is same as a posterior probability <math>P(w_{i}|x').</math> If sample sizes are big enough, it could be assumed that x' is sufficiently close to x that <math>P(w_{i}|x') = P(w_{i}|x).</math>
  
 +
----
 
=='''METRICS AND NEAREST NEIGHBOR RULE'''==
 
=='''METRICS AND NEAREST NEIGHBOR RULE'''==
 +
However, the closest distance between x' and x is determined by which metrics are used for feature space. A "metric" on a space S is a function which has following 4 properties:
 +
\begin{itemize}
 +
\item
 +
Non-negativity : $D(\vec{x_{1}},\vec{x_{2}}) \geq 0, \forall \vec{x_{1}},\vec{x_{2}} \in S$
 +
\item
 +
Symmetry : $D(\vec{x_{1}},\vec{x_{2}}) = D(\vec{x_{2}},\vec{x_{1}}), \forall \vec{x_{1}},\vec{x_{2}} \in S$
 +
\item
 +
Reflexivity : $D(\vec{x},\vec{x}) = 0, \forall \vec{x} \in S$
 +
\item
 +
Triangle Inequality : $D(\vec{x_{1}},\vec{x_{2}}) + D(\vec{x_{2}},\vec{x_{3}}) \geq D(\vec{x_{1}},\vec{x_{3}}), \forall \vec{x_{1}},\vec{x_{2}},\vec{x_{3}} \in S$
 +
\end{itemize}
  
 +
----
 
== '''References''' ==
 
== '''References''' ==
  

Revision as of 15:49, 29 April 2014


Nearest Neighbor Method

A slecture by Sang Ho Yoon

Partly based on the ECE662 Spring 2014 lecture material of Prof. Mireille Boutin.



Introduction

In this slecture, basic principles of implementing nearest neighbor rule will be covered. The error related to the nearest neighbor rule will be discussed in detail including convergence, error rate, and error bound. Since the nearest neighbor rule mostly relies on a metric function between patterns, the properties of metrics will be studied in detail. Several examples will be illustrated to help understanding throughout the lecture.


Nearest Neighbor Rule

Let's consider a testing sample x. Based on labeled training sample D$ ^n $ $ = x_{1},... ,x_{n}, $ the nearest neighbor technique will find the closest point x' to x. Then we assign the class of x' to x. This is how the classification based on the nearest neighbor rule is processed. Although this rule is very simple, it is also reasonable. The label $ \theta' $ used in the nearest neighbor is random variable which means $\theta' = w_{i}$ is same as a posterior probability $ P(w_{i}|x'). $ If sample sizes are big enough, it could be assumed that x' is sufficiently close to x that $ P(w_{i}|x') = P(w_{i}|x). $


METRICS AND NEAREST NEIGHBOR RULE

However, the closest distance between x' and x is determined by which metrics are used for feature space. A "metric" on a space S is a function which has following 4 properties: \begin{itemize} \item Non-negativity : $D(\vec{x_{1}},\vec{x_{2}}) \geq 0, \forall \vec{x_{1}},\vec{x_{2}} \in S$ \item Symmetry : $D(\vec{x_{1}},\vec{x_{2}}) = D(\vec{x_{2}},\vec{x_{1}}), \forall \vec{x_{1}},\vec{x_{2}} \in S$ \item Reflexivity : $D(\vec{x},\vec{x}) = 0, \forall \vec{x} \in S$ \item Triangle Inequality : $D(\vec{x_{1}},\vec{x_{2}}) + D(\vec{x_{2}},\vec{x_{3}}) \geq D(\vec{x_{1}},\vec{x_{3}}), \forall \vec{x_{1}},\vec{x_{2}},\vec{x_{3}} \in S$ \end{itemize}


References


Questions and comments

If you have any questions, comments, etc. please post them on this page.


Back to ECE662, Spring 2014

Alumni Liaison

Ph.D. 2007, working on developing cool imaging technologies for digital cameras, camera phones, and video surveillance cameras.

Buyue Zhang