I know that as a question it may seem stupid, but in case it is applying K NN with k = 1 and I have two neighbors at the same distance , what is the best approach to carry out the classification ?
The best approach would really depend on your application and what is important too you.
However, things you can try include:
- Increase K until there is no tie anymore - if you increase to 2, you will likely have another tie, since they are at the same distance already. So, 3 or higher should do the trick.
- Include another feature to your classifier - adding another dimension to your space could solve the problem if the values for both these data points are different.
- Choose another distance metric - you could have a preferred way of measuring distance, but for ties, chose another metric that will break it.
- Establish a rule for breaking ties, e.g.
- Pick the class with the most observed data points
- Randomly assign a class
More information on your application would help to choose a best approach.