-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interest in a mutual knn? #664
Comments
What about a keyword in symmetrize controlling if the symmetrization happens using addition or removal of asymmetric edges? It can be then exposed in the KNN builder via a keyword (feels better than another builder). |
That's a good idea imho! |
We probably want to think about the API, then... I would prefer something like the following, implemented in the def make_symmetric(w, drop=False):
if drop:
# keep only mutual neighbors
...
else:
# add all reversed links to edge set
... Also, people often do |
Are we talking about implementing it in weights or graph? If the latter, then I'd like to have it as a method. |
definitely graph. I'd like to avoid implementing things in weights. |
@knaaptime a complete out of topic but since I've noticed it in your code above. Getting focals out of the Graph via |
lol i noticed that right after i posted that photo and updated it to unique ids. thanks for the close eye! |
For a different causal inference project, I'm writing a few spatial/feature matching algorithms.
I think we may want to offer a
Mutual_KNN()
constructor inGraph
, and also bring aSymmetric_KNN()
? or havesymmetric/mutual
options in a knn constructor?This is like the current
.symmetrize()
function, but instead of adding edges to theKNN
graph to induce symmetry, it removes edges to theKNN
graph who are not mutually k-near.This could also be implemented as a separate function for arbitrary graphs after weighting/kerneling, since it's just based on the edge set:
The text was updated successfully, but these errors were encountered: