yasa.EpochByEpochAgreement.get_agreement#
- EpochByEpochAgreement.get_agreement(sample_weight=None, scorers=None, pooled=False)[source]#
Return a
pandas.DataFrameof weighted (i.e., averaged) agreement scores.- Parameters:
- sample_weightNone or
pandas.Series Sample weights passed to underlying
sklearn.metricsfunctions where possible. If apandas.Series, the index must match exactly that ofdata, which excludesARTandUNSepochs.- 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
nameis mapped to thesklearn.metrics.<name>_scorefunction (e.g."accuracy","cohen_kappa"), called withsample_weight; metrics that require extra arguments (e.g.averageforprecision) 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
DataFramewith one row per session. If True, all epochs across all sessions are pooled before computing a single set of agreement scores, returned as aSeries.
- sample_weightNone or
- Returns:
- agreement
pandas.DataFrameorpandas.Series If
pooled=False, aDataFramewith agreement metrics as columns and sessions as rows. Ifpooled=True, aSerieswith agreement metrics as index.With the default scorers, the proportion-based metrics (
accuracy,balanced_acc,precision,f1) are expressed as percentages (0-100).kappaandmccare correlation-like coefficients ranging from -1 to 1. Customscorersare returned as is.
- agreement