motiwari/BanditPAM

Support arbitrary distance metrics

Opened this issue · 2 comments

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

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?

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