-
Notifications
You must be signed in to change notification settings - Fork 46
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
[ENH] RESS implem sklearn interface #62
Conversation
I'm a bit ambivalent about this TBH. The convention for most functions in meegkit is It's true that MNE compatibility is nice, but this is a breaking change that would likely impact existing code for all users of the toolbox...
👍👍
👍 |
Regarding formatting (MNE or this other one) I don't have strong argument in favor. The only argument iwould be that is easier to iterate over epochs with the MNE formatting than with samples-first format, idk. |
HI @ludovicdmt there are still conflicts in
MNE-style ordering (trials-first) makes sense for mostly offline analyses, but sample-first makes more sense when a) there are no trials (it's much easier to consider the last dimension as optional) b) for real-time applications when the data needs to be serialised. |
Yep you are right in the buffer for my real time applications, I have data in 2D format. |
Restore some examples in the doc, use utils.gaussfilt, compute_unmixing as class attribute
Codecov Report
@@ Coverage Diff @@
## master #62 +/- ##
==========================================
+ Coverage 78.82% 78.87% +0.05%
==========================================
Files 22 22
Lines 2342 2367 +25
==========================================
+ Hits 1846 1867 +21
- Misses 496 500 +4
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Hey @ludovicdmt finally found some time to look into this. I reverted the MNE ordering, but kept the sklearn style interface Merging this, thanks! |
Hello,
I was recently asked to adapt your RESS implementation so it can be compatible with:
(n_trials, n_chans, n_samples)
(instead of(n_samples, n_chans, n_trials)
in the current implem)BaseEstimator
andTransformerMixin
instead of function andfit
andtransform
methodsI basically used your implem and just simplified some parts of it: removed the$10$ {-16}$).
fold
/unfold
/demean
function to use vectorization from Numpy, use sklearn to compute empirical covariance matrices (can be easily adapted to use another covariance matrix estimation method with regul).I compared the two implementations on randomly generated data and they outputted the same results (max difference about
I also have updated accordingly the
test_ress.py
so it can run with the new data formatting and the transformation of RESS to a class.