A Hybrid Method for Distance Metric Learning