728x90
반응형
SMALL
자동 수면 스테이징 (Automatic sleep staging)
YASA에서 자동 절전 스테이징을 수행하는 방법이 있다. 아래와 같이 몇 줄의 코드가 필요하지 않다. 여기서는 단일 EEG 채널을 사용하여 야간 수면곡선을 예측한다. 알고리즘에 대한 자세한 내용은 eLife 간행물 또는 설명서를 확인한다.
>>> sls = yasa.SleepStaging(raw, eeg_name='C3-A2')
>>> hypno_pred = sls.predict() # Predict the sleep stages
>>> hypno_pred = yasa.hypno_str_to_int(hypno_pred) # Convert "W" to 0, "N1" to 1, etc
>>> yasa.plot_hypnogram(hypno_pred); # Plot

실제 전문가 점수에 대한 동의를 계산한다.
>>> from sklearn.metrics import accuracy_score
>>> print(f"The accuracy is {100 * accuracy_score(hypno, hypno_pred):.3f}%")
The accuracy is 82.676%
https://raphaelvallat.com/yasa/build/html/quickstart.html#automatic-sleep-staging
Quickstart — yasa 0.6.1 documentation
This is an introduction to YASA, geared mainly for new users. However, you’ll need to know a bit of Python, and especially scientific libraries such as NumPy and Pandas. This tutorial also assumes that you are familiar with basic sleep research and metho
raphaelvallat.com
728x90
반응형
LIST
'Somnology > YASA' 카테고리의 다른 글
[YASA] Events detection (0) | 2022.04.25 |
---|---|
[YASA] Spectral analyses (0) | 2022.04.25 |
[YASA] Sleep statistics and stage-transition matrix (0) | 2022.04.25 |
[YASA] Data loading and preprocessing (Hypnogram) (2) (0) | 2022.04.25 |
[YASA] Data loading and preprocessing (Polysomnography data) (1) (0) | 2022.04.25 |