** Next:** Results
** Up:** Materials and Methods
** Previous:** Back-Propagation Neural Network

##

k-Nearest Neighbor Method

k-nearest neighbor (kNN) classifiers, as described in Section
1.7.1 (p. ) were
implemented using the Matlab M-files in Section 5.6
(p. ). Features were grouped by class and then
a fixed number of instances from each class were randomly assigned to
the *training* (40 instances from each class), *pick*
(20 instances from each class), and *test* (remaining 13 to 38
instances from each class) sets. The mean and standard deviation of
each feature were calculated using the instances assigned to the
training set. These values were then used to normalize the training
data to have a mean of 0 and a variance of 1. The mean and standard
deviation of the training data were also used to normalize the pick
and test sets. This normalization step was included so that all
features contributed equally to the Euclidean distance metric used to
define nearest neighbors.

To find the best value of k for each of the ten classifiers, the pick
data were classified using the training data and a range of k values
from one to ten. The best value of k was defined to be the one that
resulted in the largest average correct classification rate. This
value of k and the training data were then used to classify the test
data. This procedure was repeated ten times for each set of features
evaluated, resulting in ten kNN classifiers for a given set of
features. The classification for a particular test instance was
defined by the class from which a plurality of its k nearest neighbors
were derived. In the case of a tie (i.e., two or more classes were
equally common in the list of the k nearest neighbors), the test
instance was assigned to the `unknown' class.

The results from each of the 10 kNN classifiers were summarized with a
confusion matrix. The entries in the 10 confusion matrices were
summed across all classifiers in the trial and converted to
percentages. A second number was generated for each diagonal element
which was the percentage of the classification attempts (number of
instances in the test set minus those that were classified as
unknowns) that were successful. Overall performance of all 10
classifiers used with each feature set was summarized by calculating
the mean and variance of the classification rates from each individual
classifier. Each of these classification rates was calculated as the
mean of the diagonal elements (correct classifications) from a
confusion matrix generated from one of the 10 trials.

** Next:** Results
** Up:** Materials and Methods
** Previous:** Back-Propagation Neural Network
*Copyright ©1999 Michael V. Boland*

*1999-09-18*