On similarity prediction and pairwise clustering