Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Suppose you \"train\" the k-nearest neighbors classifier on the two-class datase

ID: 3864122 • Letter: S

Question

Suppose you "train" the k-nearest neighbors classifier on the two-class dataset shown below on the left, with circles and crosses representing the two classes. To validate the model you apply the classifier to the training data, i.e., you apply it to new yet identical data in the figure on the right and try to predict the class for each instance in the data. What is the training error when: (1) k = 1(i.e., using the nearest neighbor) and (2) k = 3 (i.e., using the 3-nearest neighbors). (a) Training dataset (circles and crosses denote different classes of instances) (b Testing dataset (triangles denote instances to. classify). The set of testing instances is identical to the set of training instances.

Explanation / Answer

1)
For K=1 the training error Terr = 0 since it compares with itself always.


2) When k =3, then
==> 1/k Summation((f(xi) ! yi))
==> As classfier function not defined in problem, we can ignore it.
So for k=3, the training error will be 1/3 ==> 0.333