yasa.EpochByEpochAgreement.get_agreement_bystage#
- EpochByEpochAgreement.get_agreement_bystage(beta=1.0, zero_division=nan)[source]#
Return a
pandas.DataFrameof unweighted (i.e., one-vs-rest) agreement scores.- Parameters:
- betafloat
Weight of recall relative to precision in the F-score. Default is 1.0 (i.e., F1). See
sklearn.metrics.precision_recall_fscore_support.- zero_division{np.nan, 0, 1, “warn”}
Value assigned to a metric whose denominator is zero, e.g.
recall(andfbeta) for a stage that is absent from the reference hypnogram of a session, orprecisionfor a stage that the observed scorer never assigned in a session. Default isnp.nan, meaning that undefined scores are left missing and therefore ignored when averaging across sessions (e.g. insummary). Set to0to count such sessions as a score of 0% instead, or to1for a score of 100%."warn"behaves like0but also emits asklearn.exceptions.UndefinedMetricWarning. Applied to all metrics, includingspecificityandnpv.Added in version 0.8.0.
- Returns:
- agreement
pandas.DataFrame A
DataFramewith agreement metrics as columns (fbeta,npv,precision,recall,specificity,support) and aMultiIndexwith sleep stage and session as rows (only sleep stage if a single session is evaluated).specificity(True Negative Rate) andnpv(Negative Predictive Value) are computed using a one-vs-rest confusion matrix per stage.All metrics are expressed as percentages (0-100), except
support, which is the number of epochs of each stage in the reference hypnogram. Asupportof 0 flags the sessions whererecallandfbetaare undefined.
- agreement