k-Nearest Neighbors
k-Nearest Neighbors (k-NN) is a simple, supervised machine learning algorithm used for classification and regression tasks. It works by identifying the k closest data points in the training set to a new data point and making predictions based on the majority class (for classification) or the average value (for regression) of those neighbors.
The distance between data points is typically measured using metrics like Euclidean distance or Manhattan distance. The choice of k can significantly affect the model's performance, as a small k may lead to noise sensitivity, while a large k can smooth out important patterns.