# create a SleepData object
from sleepscorer import Scorer, SleepData
file = SleepData('sample-psg.edf', start = 2880000, stop = 5400000,
channels={'EEG':'EEG Fpz-Cz', 'EMG':'EMG submental',
'EOG':'EOG horizontal'}, preload=False)
# Create and run Scorer
scorer = Scorer([file], hypnograms=True, demo=True)
scorer.run()
# this will only work if you have matplotlib set-up
tools.show_sample_hypnogram('sample-psg.groundtruth.csv', start=960, stop=1800)
Predicting...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:11<00:00, 2.91s/it]
Still rolling, I should fix that.
Predictions saved to sample-psg.edf.csv
assuming 0=W, 1=S1, 2=S2, 3=SWS, 4=REM
Traceback (most recent call last):
File "start.py", line 8, in <module>
scorer.run()
File "C:\Users\Igoncharov\Anaconda3\envs\env36\lib\site-packages\sleepscorer\sleepscorer.py", line 103, in run
tools.plot_hypnogram(preds, title ='Predictions for {}'.format( os.path.basename(filename)))
File "C:\Users\Igoncharov\Anaconda3\envs\env36\lib\site-packages\sleepscorer\tools.py", line 302, in plot_hypnogram
plt.yticks([0,-1,-2,-3,-4,-5], ['W','REM', 'S1', 'S2', 'SWS' ])
File "C:\Users\Igoncharov\Anaconda3\envs\env36\lib\site-packages\matplotlib\pyplot.py", line 1719, in yticks
labels = ax.set_yticklabels(labels, **kwargs)
File "C:\Users\Igoncharov\Anaconda3\envs\env36\lib\site-packages\matplotlib\axes\_base.py", line 63, in wrapper
return get_method(self)(*args, **kwargs)
File "C:\Users\Igoncharov\Anaconda3\envs\env36\lib\site-packages\matplotlib\cbook\deprecation.py", line 451, in wrapper
return func(*args, **kwargs)
File "C:\Users\Igoncharov\Anaconda3\envs\env36\lib\site-packages\matplotlib\axis.py", line 1796, in _set_ticklabels
return self.set_ticklabels(labels, minor=minor, **kwargs)
File "C:\Users\Igoncharov\Anaconda3\envs\env36\lib\site-packages\matplotlib\axis.py", line 1718, in set_ticklabels
"The number of FixedLocator locations"
ValueError: The number of FixedLocator locations (6), usually from a call to set_ticks, does not match the number of ticklabels (5).
From README: