numpy/numpy-tutorials

Tutorial Proposal: Implement KNN using numpy.

bhavukkalra opened this issue · 3 comments

Proposal

This tutorial will cover a specific use case i.e Implementing KNN using NumPy.
(KNN - K Nearest Neighbours)

What will be covered in the Tutorial?

  • KNN Implementation
  • Euclidean distance implementation
  • Tackling a standard classification problem

Problem statement used for the Tutorial

Given four data points for categories Fruit, Protein and Vegetable.
Out of these given categories, Find out in which of these the fifth input, test data point lies.

Sample Attached Jupyter Notebook - KNN Implementation

Hi @bhavukkalra - thanks for the proposal!

One thing to note it that our documentation tends to follow (loosely, sometimes) the philosophy of the Diátaxis framework which includes the distinction between tutorials (meant for less experienced users, focused on teaching and best practices, as well as foundational concepts and ideas) and how-to guides (quick and direct guides for completing specific tasks).

If your idea is to build a tutorial, that would fit in this repo. If you are planning to write a how-to guide, that would go in the main repo. Because a KNN is a very specific application and not something that you would do from scratch necessarily, I don't think it should be a how-to, but rather a tutorial.

What do you think?

Correct, I might have missed on the terminologies and the subtle difference between a How to and Tutorial. My Intention is of creating a Tutorial only.

Edited the Initial Issue comment to also reflect it.

So, will it be a good addition to this repo, What are your thoughts on this?

My general sense is that KNN is a better fit for scikit-learn, which indeed has extensive examples demonstrating use-cases and the underlying implementation.

Just my two cents though - if there's strong motivation to put something together that really focuses on numpy features then by all means feel free to do so!

Since this has been stale for ~1 year, I will go ahead and close it. Feel free to reopen or submit PRs!