Skip to content

Commit

Permalink
ENH Avoid unnecessary O(n^2) calculation in affinity propagation (#9617)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnothman committed Aug 27, 2017
1 parent d8c363f commit 7d13009
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sklearn/cluster/affinity_propagation_.py
Expand Up @@ -158,7 +158,7 @@ def affinity_propagation(S, preference=None, convergence_iter=15, max_iter=200,
if verbose:
print("Did not converge")

I = np.where(np.diag(A + R) > 0)[0]
I = np.flatnonzero(E)
K = I.size # Identify exemplars

if K > 0:
Expand Down

0 comments on commit 7d13009

Please sign in to comment.