On Tree-based Methods for Similarity Learning