# Is using bins for classification the same thing as k nearest neighbors?

I have a table: https://imgur.com/a/TZAhF The columns represent weight of groceries in a room, the rows represent temperature of the room. The values represent a likelihood the food goes bad (it's some original likelihood I came up with, not percent).

Anyways, I now have new data that I want to classify using my table. Based on whatever row and column combnation the new data point lands in, I will use that to determine predicted likelihood.

I guess this isn't exactly k nearest neighbors, but the idea is kind of similar. What would this method be called? And are these any specific statistical issues I need to look out for?

In the limit as you get infinite data and your partitions get finer at some appropriate rate, it’ll converge to the right answer. For finite amounts of data, the main concern is going to be choosing an appropriate bin size. You need the bins to have enough points in them that you get a reasonable estimate, but small enough that the behavior should be relatively constant over the bins. This is similar to choosing $k$ in a $k$-nearest neighbor problem, except that by doing kNN you get some level of automatic adjustment to different parts of the space having different densities; here you’ll either have to choose different non sizes at different points, or just hope that the density is constant enough that one global choice is reasonable. This problem is exacerbated quickly as the number of input dimensions increase.