The goal of this tutorial is to build a Python package for k-nn classification. We will implement the k-nn algorithm, write unit tests for it, and package it in a clean and organized way.
Specifically, we will cover the following topics:
- Code linting and formatting (using
ruff
) - Code documentation (using docstrings)
- Unit tests (using the
unittest
module) - Object-oriented programming (developing the knn classifier as a class inspired by scikit-learn architecture)
- Package management (using
pyproject.toml
)
Overall, the goal of this tutorial is to provide a hands-on experience with good coding practices and to give you the tools to develop your own Python packages.