WQD.6 - Classification

Sample R code for Classification
Nearest neighbor classifier is used with three levels (Low, Medium, High) of quality. It turned out that for k = 5, test data misclassification rate is lowest, when all predictors are being used.
Quality Classification | |||
Test Data | Low | Medium | High |
Low | 293 | 185 | 46 |
Medium | 267 | 595 | 215 |
High | 44 | 159 | 233 |
Accuracy | (293 + 595 + 233) / 2037 = 55% |