-
Notifications
You must be signed in to change notification settings - Fork 116
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
Hypno simulation #110
Hypno simulation #110
Conversation
Codecov ReportBase: 91.41% // Head: 91.68% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #110 +/- ##
==========================================
+ Coverage 91.41% 91.68% +0.26%
==========================================
Files 22 22
Lines 2690 2777 +87
==========================================
+ Hits 2459 2546 +87
Misses 231 231
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@remrama I am loving this so much! This is gonna be such a great addition to YASA 🚀 Added a few mostly-minor requests, but as usual great work!
@raphaelvallat I think this should be good to go. I ended up merging with master, hope it doesn't mess things up (I rebased once and got into conflict hell, don't know why, but I restarted and was afraid to try that again). |
Awesome work, merging now! |
Adds 2 new functions in the
yasa.hypno
module. See Issue #109.yasa.simulate_hypno
- Simulate a hypnogram of arbitrary length. Epochs are generated using a Markov sequence based on probabilities from an epoch-to-epoch transition probability matrix. The transition probabilities can come fromyasa.transition_matrix
, but I think the real utility is leaving the defaulttrans_probas=None
and using a previously published probability matrix based on a large dataset of healthy hypnograms.yasa.hypno_consolidate_stages
- This will take a hypnogram and drop it from a 5-stage scheme (W, 1, 2, 3, R) to one of the lower schemes (e.g., W, Light, Deep). Any scheme can be dropped to a lower scheme. This was really just added so thatyasa.simulate_hypno
could take ann_stages
argument.@raphaelvallat, I placed
yasa.hypno_consolidate_stages
in theyasa.hypno
module for now just to get this merged, but I think it should ultimately be attached as a method to the new Hypnogram class instead.