yasa.SpindlesResults#

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

Output class for spindles detection.

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

Parameters:
eventspandas.DataFrame

Output detection dataframe

dataarray_like

Original EEG data of shape (n_chan, n_samples).

data_filtarray_like

Sigma-filtered EEG data of shape (n_chan, n_samples).

sffloat

Sampling frequency of data.

ch_nameslist

Channel names.

hypnoarray_like or None

Sleep staging vector.

Methods

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

compare_channels([score, max_distance_sec, ...])

Compare detected spindles across channels.

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

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

get_coincidence_matrix([scaled])

Return the (scaled) coincidence matrix.

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, hue, time_before, ...])

Plot the average spindle.

plot_detection()

Plot an overlay of the detected spindles on the EEG signal.

summary([grp_chan, grp_stage, mask, ...])

Return a summary of the spindles detection, optionally grouped across channels and/or stage.