Python: how to get a similarity matrix symmetric

278 views Asked by At

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 ?

1

There are 1 answers

0
AudioBubble On BEST ANSWER

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