
KNearest Neighbors (KNN)
K-Nearest Neighbors (KNN) is a simple machine learning algorithm used for classification and regression. It works by finding the "k" closest data points (neighbors) to a given new point based on a distance metric, like Euclidean distance. For classification, the new point is assigned the most common category among its neighbors; for regression, it takes an average of their values. KNN is intuitive because it bases predictions on similar, nearby examples in the data, making it effective for problems where the relationship between data points is based on their similarity.