Local generalized quadratic distance metrics: application to the k-nearest neighbors classifier