biopsykit.sleep.sleep_wake_detection.algorithms.cole_kripke_old module

Sleep/Wake detection using the Cole/Kripke Algorithm.

class biopsykit.sleep.sleep_wake_detection.algorithms.cole_kripke_old.ColeKripkeOld(**kwargs)[source]

Bases: biopsykit.sleep.sleep_wake_detection.algorithms._base._SleepWakeBase

Class representing the Cole/Kripke Algorithm for sleep/wake detection based on activity counts.

The Cole/Kripke Algorithm runs sleep wake detection on epoch level activity data. Epochs are 1 minute long and activity is represented by an activity index which comes from Actigraph data or from raw acceleration data converted into activity index data.

Parameters

scale_factor (float) – scale factor to use for the predictions (default corresponds to scale factor optimized for use with the activity index, if other activity measures are desired the scale factor can be modified or optimized.) The recommended range for the scale factor is between 0.1 and 0.25 depending on the sensitivity to activity desired, and possibly the population being observed.

References

Cole, R. J., Kripke, D. F., Gruen, W., Mullaney, D. J., & Gillin, J. C. (1992). Automatic Sleep/Wake Identification From Wrist Activity. Sleep, 15(5), 461-469. https://doi.org/10.1093/sleep/15.5.461

scale_factor: float

Scale factor to use for the predictions (default corresponds to scale factor optimized for use with the activity index, if other activity measures are desired the scale factor can be modified or optimized). The recommended range for the scale factor is between 0.1 and 0.25 depending on the sensitivity to activity desired, and possibly the population being observed.

fit(data, **kwargs)[source]

Fit sleep/wake detection algorithm to input data.

Note

Algorithms that do not have to (re)fit a ML model before sleep/wake prediction, such as rule-based algorithms, will internally bypass this method as the fit step is not needed.

Parameters

data (array_like) – input data

Return type

biopsykit.utils._types.arr_t

predict(data, **kwargs)[source]

Apply sleep/wake prediction on activity index values.

Parameters

data (array_like) – array with activity index values

Returns

dataframe with sleep/wake predictions

Return type

SleepWakeDataFrame