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

Skip RANSAC predictions for channels already confirmed as bad #72

Merged
merged 2 commits into from Apr 29, 2021

Conversation

a-hurst
Copy link
Collaborator

@a-hurst a-hurst commented Apr 29, 2021

PR Description

Started work on finishing up #66 and ended up noticing this in the process. Essentially, MATLAB PREP doesn't bother to do RANSAC predictions/correlations for channels that have already been flagged as unsuitable for use as RANSAC predictors (i.e., bad by correlation, deviation, or dropout). Instead, those rows in the correlation matrix get filled with ones, so those channels are never "bad-by-RANSAC" (since they're already confirmed bad by something else).

Anyway, this reduces the RAM requirements for channel-wise RANSAC and also ends up simplifying the existing RANSAC code quite a bit (since we no longer need to pass the lists of complete/good channels all the way down to _get_ransac_pred to transform good channel indices to complete channel indices).

Merge Checklist

  • the PR has been reviewed and all comments are resolved
  • all CI checks pass
  • (if applicable): the PR description includes the phrase closes #<issue-number> to automatically close an issue
  • (if applicable): bug fixes, new features, or API changes are documented in whats_new.rst

@codecov-commenter
Copy link

Codecov Report

Merging #72 (1bf68ef) into master (0fa6ac4) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #72      +/-   ##
==========================================
- Coverage   97.15%   97.13%   -0.02%     
==========================================
  Files           7        7              
  Lines         597      594       -3     
==========================================
- Hits          580      577       -3     
  Misses         17       17              
Impacted Files Coverage Δ
pyprep/ransac.py 97.27% <100.00%> (-0.08%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0fa6ac4...1bf68ef. Read the comment docs.

Copy link
Owner

@sappelhoff sappelhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome, a nice low hanging (but somewhat hidden) fruit.

Thanks @a-hurst

@sappelhoff sappelhoff merged commit 145a5a1 into sappelhoff:master Apr 29, 2021
@sappelhoff sappelhoff added this to the 0.4.0 milestone Apr 29, 2021
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

3 participants