Predicting ligand binding to proteins by affinity fingerprinting