2nn
2nn is an abbreviation that can refer to two-nearest-neighbor concepts in various fields, most notably in machine learning and pattern recognition. In common usage within this domain, 2NN denotes the two-nearest-neighbor classifier, a simple variant of the k-nearest-neighbors (kNN) algorithm used for classification and, less commonly, regression. In a 2NN classifier, the label of a new instance is determined by the labels of its two closest training samples, measured by a chosen distance metric such as Euclidean distance.
The typical decision rule is straightforward: if the two nearest neighbors share the same class, that class
In addition to classification, 2NN may appear in other contexts. Some literature uses 2NN to denote a