skdh.activity.EqualAverageDurationThreshold#

class skdh.activity.EqualAverageDurationThreshold(min_threshold=0.0001, max_threshold=0.1, skip_threshold=0.0001, state='wake')#

Compute the threshold such that the bouts are of equal duration on either side of the threshold.

Parameters:
min_thresholdfloat, optional

Minimum threshold to use for the search. Default is 0.0001

max_thresholdfloat, optional

Maximum threshold to use for the search. Default is 0.1

skip_thresholdfloat, optional

Value to jump in the threshold grid for the search. Default is 0.0001

state{‘wake’, ‘sleep’}, optional

State during which the endpoint is being computed.

Methods

predict(results, i, accel_metric, ...)

Compute the equal average duration threshold.

reset_cached()

Called after all the blocks during the desired state have been run.

set_length_lists

predict(results, i, accel_metric, accel_metric_60, epoch_s, epochs_per_min, **kwargs)#

Compute the equal average duration threshold.

Parameters:
resultsdict

Dictionary containing the initialized results arrays. Keys in results are taken from the names of endpoints.

iint

Index of the day, used to index into individual result arrays, e.g. results[self.name][i] = 5.0

accel_metricnumpy.ndarray

Computed acceleration metric (e.g. ENMO).

accel_metric_60numpy.ndarray

Computed acceleration metric for a 60 second window.

epoch_sint

Duration in seconds of each sample of accel_metric.

epochs_per_minint

Number of epochs per minute.

reset_cached()#

Called after all the blocks during the desired state have been run. Can be used to calculate results on all data for the day/state.