PyCoffee in Porto i/o. Implement k-Nearest Neighbors in Python
Details
PyCoffee is an experimental format of informal Python meetups, organized by Python Porto in partnership with Porto i/o.
Every time we come up with a new challenge. If you are interested in sharpen your skills by participating in it, join us every other Sunday in Porto i/o Downtown.
We speak English or Portuguese, and we welcome guests with different backgrounds, coming from different countries and pursuing their own very different goals.
Any questions, please let us know!
CHALLENGE
Implement k-Nearest Neighbours in Python using numpy. We let ourselves using pandas, matplotlib and jupyter notebook for experiments and visualization.
HOMEWORK
To avoid wasting time on the event, we ask you to make some preparatory work before.
- Install Python on your laptop if it’s not installed. For data sciences it’s probably better to install Anaconda distribution (https://www.anaconda.com/distribution/), choose Python 3.7 version.
- Install a code editor or an IDE. We recommend Sublime Text (http://www.sublimetext.com) , Visual Studio Code (https://code.visualstudio.com) or PyCharm Community (https://www.jetbrains.com/pycharm/).
- Read about k-NN algorithm on Wikipedia (https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm)
- Read the tutorial on implementing k-NN from scratch (https://machinelearningmastery.com/tutorial-to-implement-k-nearest-neighbors-in-python-from-scratch/). We’ll mostly follow this tutorial, except that we let ourselves to cut corners using pandas to read CSV and using numpy to perform vector operations.
ON SITE
The goal is to familiarize ourselves with k-NN for classification, and more generally, by scientific environment of Python by implementing the algorithm ourselves and testing it on infamous Iris dataset.
We start at 10am, and we reserve last 20-30 minutes of PyCoffee to discuss the results of the work. Porto i/o provides free coffee to energize you.
We will start by recapping how k-NN works. Then we split ourselves into smaller teams and start working on a task.
MORE DETAILS
More details available on GitHub at https://github.com/pyporto/pycoffee-challenges/blob/master/implement-knn-in-python.md
