user1795509
user1795509

Reputation:

Python: how to get a similarity matrix symmetric

I am using FLANN (http://www.cs.ubc.ca/research/flann/) in k-nearest-neighbors mode to build a sparse similarity matrix in order to apply spectral clustering on a huge number of points (around a million) living in medium dimensions (around 20). How do I make it symmetric ?

Upvotes: 1

Views: 287

Answers (1)

user1795509
user1795509

Reputation:

When one builds the matrix in its IJV representation, one just has to make the union of the set of triplets (i,j,v) and the one of (j,i,v) and that's it.

PS: one can also make the intersection instead of the union

Upvotes: 1

Related Questions