-
Notifications
You must be signed in to change notification settings - Fork 28
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
custom clustering now takes position matrix instead of distance^2 matrix #87
base: custom_cluster
Are you sure you want to change the base?
custom clustering now takes position matrix instead of distance^2 matrix #87
Conversation
…rix, to allow more general clustering algorithms
Have a feeling that I've got the indices for position_matrix backwards - will try check this afternoon |
…Lite into ormorod-custom_cluster
…. I believe this is consistent with m = number of dimensions, n = number of clusters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for this @Ormorod.
I've tried to catch as many of the small errors as I can in this review. I would recommend combing through with git difftool with respect to master to check to see if there are any more instances which we've missed.
…Lite into ormorod-custom_cluster
…matrix where still required) to points
I think i've got it working again, will now swap the indices over... |
…Lite into ormorod-custom_cluster
This reverts commit e4622f5.
…Lite into ormorod-custom_cluster
I'm happy that the custom clustering interface is working as intended, I've attached a double-Gaussian likelihood comparing 9 runs with either default clustering or a copy of the knn clustering algorithm written in Python passed through the interface. wrap_cluster() increases the cluster list values by one, so that the user can provide an algorithm which numbers the clusters from 0. I'd intended to put this at the C++/Fortran join, but I couldn't see the natural place this would go. Therefore, to select default clustering, pass an array of -1. |
@@ -4,7 +4,6 @@ on: | |||
push: | |||
branches: [ master ] | |||
pull_request: | |||
branches: [ master ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you merge PolyChord:master into Ormorod:ormorod-custom_cluster so that the diff is cleaner?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would also be good to add a python test of clustering if you have time.
…nto ormorod-custom_cluster
I remembered that I had a translation of the native clustering into python down the back of the sofa, so have copied that into the new example and removed the sklearn dependence. I'll remove the redundancies (I don't think num_clusters_old gets used?) |
…k, so instead just return all of them (compute_nn()) and don't bother recalculating.
…e loop in disguise
* neighbor spelling (assuming we're sticking to American spelling!) * change NameError catch to check whether mpy4py was installed * set root=0 rather than erroneous root=root * Revert "neighbor spelling (assuming we're sticking to American spelling!)" This already appears in a different PR This reverts commit f1f52ed.
* neighbor spelling (assuming we're sticking to American spelling!) * change to checkoutv4 * change to checkout@v3 * change to pythonv4 * change to ubuntu-20.04 * return to latest ubuntu for 3.7 and 3.8, and separately include 3.6 case * include pythons up to 3.11 * enclose versions in quotes * revert spelling changes
This should allow more general clustering algorithms such as k-means.