This is a simple KNN's implementation. It uses the Euclidean distance, but you can change it by another distance.
An example of how to use it is shown in the file task_knn.py
- Python
- NumPy
Para entender melhor sobre o KNN veja o post no meu blog que explica o funcionamento do algoritmo: