K-Nearest Neighbors relies on the definition of a global metric. In contrast, Discriminant Adaptive Nearest Neighbor (DANN) computes a different metric at each query point based on a local Linear Discriminant Analysis. In this paper, we propose a technique to automatically adjust the hyper-parameters in DANN by the optimization of two quality criteria. The first one measures the quality of discrimination, while the second one maximizes the local class homogeneity. We use a Bayesian formulation to prevent overfitting.