yasa.EpochByEpochAgreement.multi_scorer#

static EpochByEpochAgreement.multi_scorer(df, scorers)[source]#

Compute multiple agreement scores from a 2-column dataframe (an optional 3rd column may contain sample weights).

This function offers convenience when calculating multiple agreement scores using pandas.DataFrame.groupby.apply. Scikit-learn doesn’t include a function that returns multiple scores, and the GroupBy implementation of apply in pandas does not accept multiple functions.

Parameters:
dfpandas.DataFrame

A DataFrame with 2 columns and length of n_samples. The first column contains reference values and second column contains observed values. If a third column, it must contain sample weights to be passed to underlying sklearn.metrics functions as sample_weight where applicable.

scorersdictionary

The scorers to be used for evaluating agreement. A dictionary with scorer names (str) as keys and functions as values.

Returns:
scoresdict

A dictionary with scorer names (str) as keys and scores (float) as values.