Skip to content

SRI-human-sleep/sleep_tracker_menu

Repository files navigation

The pipeline can be fed with pandas dataframes formatted in long format (each row corresponds to a sample). It must have at least three rows: one for subjects IDs, one containing the reference (for example, PSolysomnographic recordings) and the last containing sleep scores coming from the device under study (for example, PSG, or a wearable). Assign a clear header to each of these columns, given that headers will be used in plots. Some good headers might be "ID" for the identifier column, "Reference" for the gold-standard, and "Device" for the device under study. To create an instance of SleepTrackerMenu, pass your dataset as positional arguments, and specify at least the following parameters: the header of the ID column (id_col), the header fo the reference column (reference_col), the header(s) of the device (of devices) processed as a list. It is further necessary to specify the label for Wake and Sleep stages. Sleep Stages can be whatever combination of sleep nstaged aggregation, from binary sleep to a fully-fledged sleep classification. The last parameter to be passed will be save_path, in which it is specified the path in which save all plots. Subfolders will be automatically generated by the class during construction. Other possible parameters are optional and defaults are provided. Here follows a possible example of an instance:

sleep_tracker_menu = SleepTrackerMenu( file, id_col='ID', reference_col='Reference', device_col=['Device'], sleep_scoring={ 'Wake': 'W', 'Sleep': ["N1", "N2", "N3", "R"] }, sleep_stages={ 'REM': "R", 'NREM': ["N1", "N2", "N3"] }, # optional, only used if Hypnograms are generated save_path=save_path, # choose a folder in your system. digit=2, # optional plot_dpi=1000, # optional ci_level=0.95 # optional )

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages