A Probabilistic Theory of Supervised Similarity Learning for Pointwise ROC Curve Optimization