Skip to content

Commit 10aba34

Browse files
mxfGaelVaroquaux
authored andcommitted
fix a bug of affinity propagtion, which is caused by incorrect index
1 parent f9f9f15 commit 10aba34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scikits/learn/cluster/affinity_propagation_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def affinity_propagation(S, p=None, convit=30, max_iter=200, damping=0.5,
138138
# Refine the final set of exemplars and clusters and return results
139139
for k in range(K):
140140
ii = np.where(c==k)[0]
141-
j = np.argmax(np.sum(S[ii, ii], axis=0))
141+
j = np.argmax(np.sum(S[ii[:,np.newaxis], ii], axis=0))
142142
I[k] = ii[j]
143143

144144
c = np.argmax(S[:, I], axis=1)

0 commit comments

Comments
 (0)