yasa.SleepStatsAgreement.calibrate#
- SleepStatsAgreement.calibrate(data, bias_method='auto')[source]#
Calibrate a
DataFrameof sleep statistics from a new scorer based on observed biases inobs_data/obs_scorer.- Parameters:
- data
pandas.DataFrame A
pandas.DataFramewith sleep statistics from an observed scorer. Rows are unique observations and columns are unique sleep statistics.- bias_methodstr
If
'param', sleep statistics are always adjusted based on parametric bias, i.e. the mean difference is subtracted fromdata. If'auto'(default), the parametric bias is used for all sleep statistics with a constant bias, and aNotImplementedErroris raised ifdatacontains a sleep statistic with a proportional bias (seeassumptions).'regr'(regression-modeled bias) is not implemented yet and raises aNotImplementedError.See also
- data
- Returns:
- calibrated_data
pandas.DataFrame A
DataFramewith calibrated sleep statistics:x - bias_mean.
- calibrated_data
- Raises:
- NotImplementedError
If
bias_method='regr', or ifbias_method='auto'anddatacontains a sleep statistic with a proportional bias. To calibrate only the statistics with a constant bias, subset the columns ofdata, or usebias_method='param'to subtract the mean difference from all statistics.