Affinity must be 'precomputed' or 'euclidean'