skdh.activity.MaxAcceleration#
- class skdh.activity.MaxAcceleration(window_lengths, required_points=1.0, state='wake')#
Compute the maximum acceleration over windows of the specified length.
- Parameters:
- window_lengths{list, int}
List of window lengths, or a single window length.
- required_pointsint, float, optional
Number of points required in the window to compute the endpoint. If float, should be between 0 and 1 and will be interpreted as a fraction of the total number of points in the window. Default is 1.0, meaning all points in the window must be present.
- state{‘wake’, ‘sleep}
State during which the endpoint is being computed.
Methods
predict(results, i, accel_metric, ...)Compute the maximum acceleration during this set of data, and compare it to the previous largest detected value.
reset_cached()Called after all the blocks during the desired state have been run.
- predict(results, i, accel_metric, accel_metric_60, epoch_s, epochs_per_min, **kwargs)#
Compute the maximum acceleration during this set of data, and compare it to the previous largest detected value.
- 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.