Anti symmetric adjacency matrix using sklearn #3449
Answered
by
rusty1s
adhikarirsr
asked this question in
Q&A
-
I have a code as follows:
I want to make an undirected graph. However ,sklearn gives me an antisymmetric matrix. Is there a way to get a symmetric adjacency matrix for the case above? |
Beta Was this translation helpful? Give feedback.
Answered by
rusty1s
Nov 8, 2021
Replies: 1 comment 2 replies
-
adj11 = adj11 + adj11.T
adj11[adj > 1] = 1. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
adhikarirsr
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
k
-nearest neighbor graphs are always directed. You can make it undirected as follows: