-Nearest Neighbour

Same as the K-NN algorithm but instead of choosing an arbitrary , we make it a function of .

~Ex.:

We instead need to choose a function, and it needs to respect these two necessary and sufficient conditions:

For instance satisfy both conditions. We can also add an hyperparameter: , like which will make the function more flexible.

The pdf estimation is as always:


Professor Explanation:

Given that we could have some problems:

  • If is too small ⇒ .
  • If is too big ⇒ .

We can solve this problem generalizing the value of , first we want to assert that:

A possible solution to this problem is taking , such that:

Now instead of deciding the Volume we create it this way:

  1. Chose our center
  2. Create an hypersphere of dimension around
  3. Let the sphere expand until it includes data.
  4. Calculate the volume of this hypersphere.

To have more flexibility we can define where is an hyperparameter decided arbitrarily.