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

raw : mne.io.Raw

The raw iEEG data.

df : pd.DataFrame

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

Returns

raw_df : pd.DataFrame

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

ch_results : list[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.

Examples using mne_hfo.sklearn.make_Xy_sklearn