A Direct Algorithm for the K-Nearest-Neighbor Classifier via Local Warping of the Distance Metric