The first algorithm applied is the Nearest Neighbor. To classify a new instance we consider the k nearest points in terms of Euclidean distance. The refinement considered is to weight the contribution of each of the k nearest neighbors according to the query point, giving greater weight to closer neighbors. This weight is , where x is the new instance to classify.