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, which excludes ART and UNS epochs.

scorersNone, list, or dictionary

The scorers to be used for evaluating agreement. If None (default), default scorers are used. If a list of strings, each name is mapped to the sklearn.metrics.<name>_score function (e.g. "accuracy", "cohen_kappa"), called with sample_weight; metrics that require extra arguments (e.g. average for precision) must be passed as a dictionary instead. If a dictionary, keys are scorer names (str) and values are functions taking 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.

With the default scorers, the proportion-based metrics (accuracy, balanced_acc, precision, f1) are expressed as percentages (0-100). kappa and mcc are correlation-like coefficients ranging from -1 to 1. Custom scorers are returned as is.