k-Nearest Neighbors (k-NN)

k-Nearest Neighbors (k-NN) is an intuitive algorithm that classifies or predicts a value based on the k closest training examples. It is non-parametric and instance-based, performing computation during prediction rather than training.

Example: To estimate a house price, you would look at similar houses in the neighborhood and average their prices. k-NN follows this idea with k=5 (for example), making predictions based on nearby samples.