yasa.EpochByEpochAgreement.get_agreement#

EpochByEpochAgreement.get_agreement(sample_weight=None, scorers=None, pooled=False)[source]#

Return a pandas.DataFrame of weighted (i.e., averaged) agreement scores.

Parameters:
sample_weightNone or pandas.Series

Sample weights passed to underlying sklearn.metrics functions where possible. If a pandas.Series, the index must match exactly that of data.

scorersNone, list, or dictionary

The scorers to be used for evaluating agreement. If None (default), default scorers are used. If a list, the list must contain strings that represent metrics from the sklearn metrics module (e.g., accuracy, precision). If more customization is desired, a dictionary can be passed with scorer names (str) as keys and custom functions as values. The custom functions should take 3 positional arguments (true values, predicted values, and sample weights).

pooledbool

If False (default), agreement scores are computed per session and returned as a DataFrame with one row per session. If True, all epochs across all sessions are pooled before computing a single set of agreement scores, returned as a Series.

Returns:
agreementpandas.DataFrame or pandas.Series

If pooled=False, a DataFrame with agreement metrics as columns and sessions as rows. If pooled=True, a Series with agreement metrics as index.