yasa.REMResults#

class yasa.REMResults(events, data, sf, ch_names, hypno, data_filt)[source]#

Output class for REMs detection.

The parameters are stored as private attributes, e.g. self._events.

Parameters:
eventspandas.DataFrame

Output detection dataframe

dataarray_like

EOG data of shape (n_chan, n_samples), where the two channels are LOC and ROC.

data_filtarray_like

Filtered EOG data of shape (n_chan, n_samples), where the two channels are LOC and ROC.

sffloat

Sampling frequency of data.

ch_nameslist

Channel names (= ['LOC', 'ROC'])

hypnoarray_like or None

Sleep staging vector.

Methods

__init__(events, data, sf, ch_names, hypno, ...)

compare_channels([score, max_distance_sec])

Not available for REMs, which are detected on the combination of LOC and ROC.

compare_detection(other[, max_distance_sec, ...])

Compare the detected REMs against either another YASA detection or against custom annotations (e.g. ground-truth human scoring).

get_coincidence_matrix([scaled])

Not available for REMs, which are detected on the combination of LOC and ROC.

get_mask()

Return an array indicating for each sample in data if this sample is part of a detected event (1) or not (0).

get_sync_events([center, time_before, ...])

Return the raw or filtered data of each detected event after centering to a specific timepoint.

plot_average([center, time_before, ...])

Plot the average REM.

plot_detection()

Plot an overlay of the detected REMs on the LOC and ROC signals.

summary([grp_stage, mask, aggfunc, sort])

Return a summary of the REM detection, optionally grouped across stage.