A machine learning algorithm used primarily for classification in which the machine aims to find the classification based on the nearest K neighbors in the data set, with K being a user-defined variable for how many neighbors should be evaluated. KNN is considered to be a “lazy learning” approach in that very little time is spent on training a machine learning model, while the computation time is deferred to the time spent looking for the nearest neighbors.