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

Sklearn compatibility #287

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

darikoneil
Copy link

Added decorator to adjust the arguments to the sklearn's NMF constructor such that the >=1.0 implementation's objective is identical to <= 1.0 implementation. Specifically, it generates alpha_W & alpha_H from the passed alpha parameter such that the alpha's in the objective match after scaling (there is not option to turn off scaling the alpha's in the new implementation). Results match original implementation with 1e-7 tolerance. Not sure if fix is compatible with python 2.

Added option for MiniBatchNMF with decorator so that it is also compatible.

@codecov
Copy link

codecov bot commented Jun 21, 2023

Codecov Report

Patch coverage: 40.90% and project coverage change: -11.46 ⚠️

Comparison is base (8cf6a17) 94.08% compared to head (caec4d6) 82.63%.

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #287       +/-   ##
===========================================
- Coverage   94.08%   82.63%   -11.46%     
===========================================
  Files           8        8               
  Lines        1217     1215        -2     
  Branches      313      306        -7     
===========================================
- Hits         1145     1004      -141     
- Misses         36      173      +137     
- Partials       36       38        +2     
Flag Coverage Δ
nbsmoke ?
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
fissa/neuropil.py 80.72% <40.90%> (-14.74%) ⬇️

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@nathalierochefort
Copy link
Member

Thank you very much for the pull request, it's a great change. We won't currently integrate it directly but will point other users to this pull request if they need it, with new versions of sklearn.

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.

None yet

2 participants