# k-NN

When we estimate the height of a point in the map, we use the information around the point. k-NN is an application of this calculation.

k-NN is a method to predict unknown Y using X. It is useful to find local property.

## Process of k-NN

At first we use the distance function. If we have X data of A, we measure the place of X in the Xs already known.

Second we use the combination function. We calculate the size of unknown Y by the Ys around the unknown Y.

For example, we use Euclidean distance as distance function. And we use average as combination function.

If Y is a categorical variable, we calculate the probability of the category or decide from the majority.

## Name

k-NN stands for "k Nearest Neighbor algorithm."

It is also called, "Memory-Based Reasoning" and "MBR."

### Case Based Reasoning

Name and concept of case based reasoning and memory based reasoning are similar. But the target of case based reasoning is not numerical data.

This method is used to study judgment of new event.

NEXT LOF