BanditPAM icon indicating copy to clipboard operation
BanditPAM copied to clipboard

predict function for Python implementation?

Open m-muaz opened this issue 2 years ago • 3 comments

Hi! Thank you for releasing the code and the Python package. I was using the python implementation installed using pip. While I was working, I noticed that there is no method 'predict' for the class KMediods. Is it something that was omitted intentionally or will it be added later in the future?

Thanks

m-muaz avatar Apr 28 '22 16:04 m-muaz

Thanks for the feature request. I'll implement this in a future release.

Just to set expectations, I've paused maintaining this repo until the end of June while I work on other projects in my PhD. If you need it sooner, I can provide details on how to fork this repo and implement it locally

motiwari avatar Apr 28 '22 17:04 motiwari

I will appreciate it if you can let me know the implementation details! Thanks!

m-muaz avatar Apr 28 '22 17:04 m-muaz

Of course! Here are the steps you would need to take:

  • Fork this repo
  • Implement a KMedoids::predict in kmedoids_algorithm.cpp, similar to KMedoids::calcLoss and add the function signature to the associated header file
  • Add a Python binding (new file in C++) for the new function similar to labels_python.cpp and add to the corresponding header
  • Build the local repository, with your modifications, from source (Mac instructions)
  • After testing locally, submit a PR to merge into this repository

Let me know if you have any questions!

motiwari avatar Apr 28 '22 17:04 motiwari