Learning Clusterwise Similarity with First-Order Features