Published October 25, 2026 | Version v0.8.1

raphaelvallat/yasa: v0.8.1

Description

This is a minor release. Its highlight is the support for repeated measures in the evaluation module, for validation studies that record several nights per participant. It also adds a new method to compare detected events based on their overlap and fixes a deprecation warning with pandas 3.1.

Evaluation module: support several nights per subject (repeated measures)

yasa.EpochByEpochAgreement and yasa.SleepStatsAgreement accept a new subjects argument that tells YASA which participant each night belongs to. The nights of a participant are not independent, and treating them as such makes the confidence intervals and p-values too small. With subjects, both classes account for the clustering of nights within participants, following Bland & Altman (2007), Zou (2013) and Parker et al. (2016). With one night per participant, the results are unchanged. See the new Several nights per subject section of the evaluation tutorial. (#279)

Improvements

  • yasa.compare_detection and the compare_channels and compare_detection methods of the detection results accept method="intersection" to match events based on the overlap of their intervals (intersection over union) instead of the distance between their onsets. This makes it possible to compare detections with different sampling frequencies, and prevents split, merged or duplicate detections from all counting as true positives. The default method="distance" is unchanged. (#88, #278)
  • compare_channels is up to 6 times faster, as the events of each channel are now validated and sorted once and each pair of channels is compared once. (#282)

Bugfixes

  • Fixed a Pandas4Warning in yasa.SleepStaging with pandas 3.1, which deprecates the inplace keyword of sort_index. (#283)

Dependencies

  • statsmodels is a new optional dependency, required only for the mixed models of yasa.SleepStatsAgreement with several nights per participant. Install it with pip install yasa[stats] (included in yasa[full]).

Contributors

Files

raphaelvallat/yasa-v0.8.1.zip

Files (35.5 MB)

Name Size
md5:75b0912bdcc727f685ca85fa41dbd878
35.5 MB Preview Download

Additional details

Related works