Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minkowski distance #296

Closed
bvenn opened this issue Sep 21, 2023 · 4 comments · Fixed by #308
Closed

Minkowski distance #296

bvenn opened this issue Sep 21, 2023 · 4 comments · Fixed by #308
Labels
Difficulty: Beginner Hackathon projects with beginner difficulty FsLab Hackathon 2023 Implementation projects for the 2023 FsLab Hackathon Status: In Progress

Comments

@bvenn
Copy link
Member

bvenn commented Sep 21, 2023

Description

The Minkowski distance or Minkowski metric is a metric in a normed vector space which can be considered as a generalization of both the Euclidean distance and the Manhattan distance. [1]

References

Pointers

  • the implementation should be located here: https://github.com/fslaborg/FSharp.Stats/blob/developer/src/FSharp.Stats/DistanceMetrics.fs
  • within FSharp.Stats.DistanceMetrics, there are specialized modules Vector and Array, that contain the same functionality as the overarching module, but are optimized for high performance. You should first implement a version, that works on two sequences of generic type and if appropriate add optimized versions within DistanceMetrics.Vector and DistanceMetrics.Array.
  • if not inferred automatically, you can ensure that the function works on any input collection (float, int), by adding the inline keyword
    let inline minkowski (s1: seq<'a>) (s1: seq<'a>) (p: int) : float =
        //iterate over both collections and determine the Minkowski distance
        //using a single fold function may be sufficient
  • optional: add unit tests for sequences of int, float according to this example.
    • don't forget to test negative values within the input sequence, as well as 0. and nan entries
  • optional: add proper XML documentation [Feature Request] Update all comments according to XML documentation styling #281
  • Of course you can start developing in notebooks/scripts and afterwards we try to incorporate into the library.
Hints (click to expand if you need additional pointers)
@bvenn bvenn added Difficulty: Beginner Hackathon projects with beginner difficulty FsLab Hackathon 2023 Implementation projects for the 2023 FsLab Hackathon Status: Available labels Sep 21, 2023
@s-weil
Copy link
Contributor

s-weil commented Sep 30, 2023

I will work on this issue

@s-weil
Copy link
Contributor

s-weil commented Oct 2, 2023

Hi @bvenn

I would like to open my PR on this issue, but haven't been able to publish my branch yet.
Are there any write restrictions in place?
Thanks a lot for the help

@bvenn
Copy link
Member Author

bvenn commented Oct 2, 2023

Hi @s-weil

first of all: Thank you for your contribution 👍

You have to fork the repo and open a PR from the feature-branch of your fork to the developer branch of fslaborg. I hope that helps. If not, dont hesitate in contacting again.

@s-weil
Copy link
Contributor

s-weil commented Oct 3, 2023

Thanks, that helped. the PR is here: #308

@bvenn bvenn closed this as completed in #308 Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty: Beginner Hackathon projects with beginner difficulty FsLab Hackathon 2023 Implementation projects for the 2023 FsLab Hackathon Status: In Progress
Projects
Status: Status: Completed
Development

Successfully merging a pull request may close this issue.

2 participants