mne_hfo.match_detected_annotations

mne_hfo.match_detected_annotations(ytrue_annot_df, ypred_annot_df, ch_names=None, label=None, sec_margin=1.0, method='match-true')[source]

Given two annotations.tsv DataFrames, match HFO detection overlaps.

Parameters

ytrue_annot_df : pd.DataFrame

The reference annotations DataFrame containing the HFO events that are considered “ground-truth” in this comparison.

ypred_annot_df : pd.DataFrame

The estimated annotations DataFrame containing the HFO events that are estimated using a Detector.

ch_names : list | str | None

Which channels to match. If None (default), then will match all available channels in both dataframes. If str, then must be a single channel name available in the ytrue_annot_df. If list of strings, then must be a list of channel names available in the ytrue_annot_df.

label : str | None

The HFO label to use. If None (default) will consider all rows in both input DataFrames as an HFO event. If a string, then it must match to an element of label column in the dataframes.

sec_margin : float

Number of seconds to consider a valid checking window. Default = 1.

method : str

Type of strategy for matching HFO events. Must be one of match-true, match-pred, or match-total. If “match-true”, will return a dataframe of all true indices and matching predicted indices if they exist. If “match-pred”, will return a dataframe of all predicted indices and matching true indices if they exist. If “match-total”, will return the concatenation of the two. See Notes for more information.

Returns

matched_df : pd.DataFrame

A DataFrame with the columns pred_index and true_index, which corresponds to indices,

Examples using mne_hfo.match_detected_annotations