Skip to content

"Paired" distance function for haversine distance #17212

Open

Description

@zachmayer

Describe the workflow you want to enable

I want to be able to calculate paired distance between 2 arrays with equal dimension, using haversine distance.

Describe your proposed solution

https://stackoverflow.com/questions/29545704/fast-haversine-approximation-python-pandas/29546836#29546836

Describe alternatives you've considered, if relevant

I can roll my own function using the above code from stackoverflow, but I'd rather import from sklearn.

Additional context

Currently paired_distances supports the following options:

PAIRED_DISTANCES = {
    'cosine': paired_cosine_distances,
    'euclidean': paired_euclidean_distances,
    'l2': paired_euclidean_distances,
    'l1': paired_manhattan_distances,
    'manhattan': paired_manhattan_distances,
    'cityblock': paired_manhattan_distances}

There's code out there on stackoverlow for a fast and paired implementation of haversine distance: https://stackoverflow.com/questions/29545704/fast-haversine-approximation-python-pandas/29546836#29546836

It seems like this would be useful to have in sklearn

Activity

  1. jnothman commented on May 14, 2020

    @jnothman
    Member

    PR welcome IMO. Just take care with code licenses.

  2. acharles7 commented on May 14, 2020

    @acharles7
    Contributor

    I would like to work on this

  3. tarun42 commented on May 16, 2020

    @tarun42

    hey @zachmayer , I am beginner to open source community.
    Can i help to contribute for this issue. I have gone through links you have mentioned in issue.
    for a beginner like me implementing a function for scikit-learn would be really helpfull.

  4. zachmayer commented on May 18, 2020

    @zachmayer
    ContributorAuthor

    Hi @acharles7 and @tarun42 : thanks for the offer! However, @jona-sassenhagen is going to implement this one.

  5. zachmayer commented on May 18, 2020

    @zachmayer
    ContributorAuthor

    Looks like @acharles7 already made a PR. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions