raphaelvallat / yasa

YASA (Yet Another Spindle Algorithm): a Python package to analyze polysomnographic sleep recordings.
https://raphaelvallat.com/yasa/
BSD 3-Clause "New" or "Revised" License
424 stars 115 forks source link

how to classify apnea? #134

Closed TTyb closed 1 year ago

TTyb commented 1 year ago

I have a batch of edf data, which includes Airflow, Resp Chest, Resp Abdomen, and SaO2 SpO2 annotations as x, and central apnea, mixed apnea, obstructive apnea, and central hyporespiration are used as labels. I want to classify them. It's kind of like sleep staging, how to use yasa for feature extraction and multiple classification? Thank you

labels is :

start_time = np.around(raw.annotations.onset, decimals=3)
annotation_name = raw.annotations.description
duration_time = raw.annotations.duration

print(start_time)
print(annotation_name)
print(duration_time)

X is: image

If you need the sample of edf data, can use mne. Datasets. Testing. Data_path () to get test edf,

raphaelvallat commented 1 year ago

Hi,

I am afraid this is too complicated of a question for a simple and straightforward answer. Sleep apnea classification is something that I've worked on in the past and it's really not that easy. Re-using the features from the sleep staging algorithm will not work, and you will need to manually craft features from the SpO2 signal, respiration and ECG signals.

There are a few peer-reviewed scientific articles on the topic, which you can find on Google Scholar. I suggest you have a look at those and try to re-implement some of their step, including features calculation and machine-learning classification.

Thanks, Raphael

TTyb commented 1 year ago

已收到,谢谢