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

Addition of Normalized Mutual Information #314

Merged
merged 3 commits into from
Feb 9, 2024

Conversation

Christtella
Copy link
Contributor

closes #313

Please list the changes introduced in this PR

  • Addition of Normalized Mutual Information
  • Added Unit tests

Description
NMI is a measure used to evaluate clustering quality.

[Required] please make sure you checked that

  • The project builds without problems on your machine

[Optional]

  • Added unit tests regarding the added features

@bvenn
Copy link
Member

bvenn commented Feb 8, 2024

Thanks @Christtella for this addition 🚀

@ZimmerD, could you please take a look at this feature addition? I'll take a look at it too, but I know you've contributed here.

@bvenn
Copy link
Member

bvenn commented Feb 8, 2024

@ZimmerD @Christtella, would make sense to couple both input sequences? If you accidentally change one or both sequences during processing (e.g. sorting), the resulting NMI will be corrupted. If the input were an array of tuples instead of two separate sequences, it might be much safer to use.
The only drawback I can think of is that the parameter order is no longer intuitive and must be checked from the function description.

//current
let calcNMI (expected: int[]) (actual: int []) = ...

//proposed
let calcNMI (input: (int*int)[]) = ...

@codecov-commenter
Copy link

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (6c97a2b) 47.16% compared to head (f2b61fb) 47.31%.

Files Patch % Lines
src/FSharp.Stats/ML/Unsupervised/ClusterNumber.fs 77.77% 0 Missing and 8 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           developer     #314      +/-   ##
=============================================
+ Coverage      47.16%   47.31%   +0.15%     
=============================================
  Files            149      150       +1     
  Lines          16567    16629      +62     
  Branches        2230     2245      +15     
=============================================
+ Hits            7813     7868      +55     
+ Misses          8077     8076       -1     
- Partials         677      685       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bvenn bvenn merged commit 4aa9e0e into fslaborg:developer Feb 9, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]addition of Normalized Mutual Information
3 participants