mne_hfo.sklearn.make_Xy_sklearn#

mne_hfo.sklearn.make_Xy_sklearn(raw, df)[source]#

Make X/y for HFO detector compliant with scikit-learn.

To render a dataframe “sklearn” compatible, by turning it into a list of list of tuples.

Parameters:
rawmne.io.Raw

The raw iEEG data.

dfpd.DataFrame

The HFO labeled dataframe, in the form of *_annotations.tsv. Should be read in through read_annotations function.

Returns:
raw_dfpd.DataFrame

The Raw dataframe generated from mne.io.Raw.to_data_frame(). It should be structured as channels X time.

ch_resultslist[list[tuple]]

List of channel HFO events, ordered by the channel names from the raw dataset. Each channel corresponds to a list of “onset” and “offset” time points (in seconds) that an HFO was detected.