motiwari / BanditPAM

BanditPAM C++ implementation and Python package
MIT License
647 stars 38 forks source link

Support arbitrary distance metrics #4

Open motiwari opened 3 years ago

motiwari commented 3 years ago

We should have an easy way for users to incorporate their own dissimilarity metrics. Users should be able to write their dissimilarity metric in Python, which is then called via the C++ code.

User feedback suggests allowing users to pass the reference to the function that will compute distances. Asking the user to supply the O(n^2) distance matrix is of course infeasible.

This is a several-step task, including:

  1. Making the Python function callable via the C++ (C++ bindings for the Python code); perhaps via some translation
  2. Updating the C++ code to use this custom function. Some relevant code
tanweer-mahdi commented 2 years ago

Hi @motiwari , do you currently recommend implementing custom distance metrics locally? Or shall I create a branch, code the distance metric in C++ as you suggested in the README and create a PR?

motiwari commented 2 years ago

@tanweer-mahdi the latter option is welcome and I'd be happy to review a PR!