This section continues the exploration of augmenting Naive Bayes with a clustering pre processor. After Greedy Agglomerative Clustering, I chose to examine K-Means. Three different values of $K$ are used: 10, 25, and 50. This means that 10, 25, and 50 clusters are initially created, although for smaller datasets like KC3(\tbl{KMeans-kc3}) and AR5(\tbl{KMeans-ar5}) less clusters are used. In this section, Naive Bayes empirically represents an implementation of K-Means where $K = 1$. \label{pg:results-4}

When classifying the testing data, each cluster trains a Naive Bayes classifier with the training data assigned to it. Each testing instance is assigned to the nearest cluster, with nearest being defined as the cluster that has the smalled Euclidean distance between the testing instance and the cluster centroid.

The results of the K-Means tests show amazing uniformity in the Mann Whitney Wilcoxin ranks. \tbl{KMeans-ar3} - \tbl{KMeans-mw1} shows these results. Naive Bayes has the highest ranked Probability of Detection and the lowest ranked Probability of False Alarm of all 4 classifiers. As for K-Means, for each dataset, as well as for the overall look over all 8 datasets, the median Probability of Detection and Probability of False Alarm falls as $K$ increases. This proportional drop in PD and PF is similar to the reports in \tion{main-results}. There are several datasets which show a median PD and PF of 0. This is attributed to the smaller sizes of the datasets and/or a reduced number of defective modules in the testing dataset. 

K-Means, when used as a pre-processing filter for Naive Bayes, functions by creating a Naive Bayes training module for each cluster, and classifying the testing data on the module for each instances nearest cluster. This follows the concept of locality by training on only the local data. If the concept of locality, that local data should improve classification performance, held true, there should have been a proportional increase in PD or decrease in PF as the number of clusters increased\footnote{Each dataset has a theoretical maximum number of clusters that act to reduce the intra cluster variance. Once this number of clusters is reached, one can expect the classification performance to decrease}. \tbl{KMeans-all} clearly shows a proportional decrease in both PD and PF.

\input{tables/kmeans-ar3}
\input{tables/kmeans-ar4}
\input{tables/kmeans-ar5}
\input{tables/kmeans-cm1}
\input{tables/kmeans-kc1}
\input{tables/kmeans-kc2}
\input{tables/kmeans-kc3}
\input{tables/kmeans-mc2}
\input{tables/kmeans-mw1}
\input{tables/kmeans-all}
