Random Forests for Metric Learning with Implicit Pairwise Position Dependence