Score Sleep Stages YASA
Module name: YasaSleepStaging
Package: CEAMSModules 7.4.0
Version: 2.0.0
Overview
Automatic sleep stage classification using YASA’s machine learning model. Handles both validation (against expert scores) and prediction modes.
Inputs
Input |
Format |
Default |
Description |
|---|---|---|---|
|
str |
— |
Path to the input data file |
|
list |
— |
List of EEG signal objects (required) |
|
list |
— |
List of EOG signal objects (optional) |
|
list |
— |
List of EMG signal objects (optional) |
|
pd.DataFrame |
— |
Expert-scored sleep stages (required in validation mode) |
|
str |
— |
group to add the predicted stages |
|
bool |
— |
Flag indicating validation mode (True) or prediction mode (False) |
Outputs
Output |
Format |
Description |
|---|---|---|
|
pd.DataFrame |
Classification metrics (accuracy, kappa, confidence, F1 scores) |
|
list |
Contains [ground_truth_hypnogram, predicted_hypnogram, filename] |
|
pd.DataFrame |
Updated events with predicted sleep stages |
|
list of tuple of n events to remove. |
[(‘group1’, ‘name1’), (‘group2’, ‘name2’)] |
Usage in a process
Open Dev Tools -> New process in Snooz.
In the Module Library, find Score Sleep Stages YASA under the Signal Processing category.
Drag the module onto the process canvas.
Connect the required inputs from upstream modules (or set values in the Settings tab).
Connect outputs to downstream modules as needed.
Double-click the module to configure parameters in the Settings tab.
Run the process and inspect results in the Results tab.
Note
For general guidance on building processes with modules, see Explore examples.