Skip to content

StillWaterRunsDeep/sleep_classifiers

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sleep_classifiers

This code uses scikit-learn to classify sleep based on acceleration and photoplethymography-derived heart rate from the Apple Watch. The paper associated with the work is available here.

Getting Started

This code uses Python 3.7.

Data

Data collected using the Apple Watch is available on PhysioNet: link

The MESA dataset is available for download at the National Sleep Research Resource. You will have to request access from NSRR for the data.

Features + figures

All raw data are cleaned and features are generated in preprocessing_runner.py.

The file analysis_runner.py can be used to generate figures showing classifier performance. You can comment and uncomment the figures you want to run.

Notes

  • In the blue motion-only classifier performance lines in Figures 4 and 8 in the paper, labels for REM and NREM sleep are switched. NREM sleep is the dashed line and REM is the dotted line.
  • The subset of the MESA dataset used for comparison in the paper are the first 188 subjects with valid data, in order of increasing Subject ID.

License

This software is open source and under an MIT license.

About

Classify sleep from heart rate and acceleration via Apple Watch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 89.4%
  • MATLAB 10.6%