Efficiently Learning a Distance Metric for Large Margin Nearest Neighbor Classification