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

Hamming distance #294

Closed
bvenn opened this issue Sep 21, 2023 · 1 comment · Fixed by #303
Closed

Hamming distance #294

bvenn opened this issue Sep 21, 2023 · 1 comment · Fixed by #303
Labels
Difficulty: Beginner Hackathon projects with beginner difficulty FsLab Hackathon 2023 Implementation projects for the 2023 FsLab Hackathon

Comments

@bvenn
Copy link
Member

bvenn commented Sep 21, 2023

Description

The Hamming distance is used to determine the number of positions at which two sequences of equal size differ [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 (seq, string, seq), by adding the inline keyword
    let inline hamming (s1: 'a) (s2: 'a) : int =
        //iterate over both sequences and compare the entries at each index for equality
        //since the hamming distance is the number of unequal comparisons the result is and integer
  • optional: add unit tests for sequences of int, float, and strings according to this.
    • 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
@Samo8
Copy link
Contributor

Samo8 commented Sep 30, 2023

On it

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
Projects
Status: Status: Completed
Development

Successfully merging a pull request may close this issue.

2 participants