Supervised Learning of Similarity