Lectures on the nearest neighbor method. (2015)