1. A method of training a K nearest neighbor classifier, comprising: obtaining a set of data comprising a first subset of training data and a second subset of training data; training the K nearest neighbor classifier on the first subset of training data; sequentially processing the second subset of training data to compute K nearest neighbor classifier outputs for respective points of the second set of training data; and determining parameters for a parametric model according to the K nearest neighbor classifier outputs, and true outputs of respective points of the second set of training data.