Open freemansw1 opened 2 years ago
This sounds awesome! It's always a big win when the call signature doesn't change. That said, it looks like some of the sklearn metrics require arguments, most notably Minkowski. Would it make sense for dist_func
to accept any DistanceMetric
instance instead? Or, is it worth the extra code (and docstring text) to allow both strings and instances?
Okay, great! I put in a PR (#692) to allow the user to pass any DistanceMetric
class. I agree that that is generally better than allowing the user to pass in a string. I think it would also enable the user to extend the DistanceMetric
class with their class and/or metrics, which would be great generally!
Hi,
I'm curious if the maintainers would be amenable to a PR that allows for users to input a string that is passed to scikit-learn for
dist_func
intrackpy.link
et al. Allowing a user-passed pythondist_func
is great, but some of theDistanceMetric
s available in scikit-learn (https://scikit-learn.org/stable/modules/generated/sklearn.metrics.DistanceMetric.html?highlight=distancemetric#sklearn.metrics.DistanceMetric) are useful and can be substantially faster than passing along a python function.I'm happy to put together a PR allowing
dist_func
to be a string or a python function, and if it is a string, to pull a scikit-learnDistanceMetric
object, if the maintainers are interested.