I have a question regarding the Condensed Nearest Neighbors algorithm:
enter image description here

Why am I returning Z, which if I understand correctly, is the array of all of the misclassified points? Wouldn't I want to return the points that were classified correctly? What benefit does this give me in returning all the points I got wrong?


1 Answer 1


Condensed Nearest Neighbors algorithm helps to reduce the dataset X for k-NN classification. It constructs a subset of examples which are able to correctly classify the original data set using a 1-NN algorithm.

It is returning not the array of misclassified points, but a subset Z of the data set X.

CNN works like that:

1) Scan all elements of X, looking for an element x whose nearest prototype from Z has a different label than x

2) Remove x from X and add it to Z

3) Repeat the scan until no more prototypes are added to Z

Z used instead of X for kNN classification.

An advantage of this method is decreasing of execution time, reducing a space complexity


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.