dispel.providers.generic.activity.placement module#
All generic transformation steps related to the placement.
- class dispel.providers.generic.activity.placement.ClassifyPlacement[source]#
 Bases:
TransformStepClassify placement in 100 ms windows.
- data_set_ids: str | Iterable[str] = ['acc_ts_resampled', 'acc_ts_resampled_euclidean_norm']#
 An iterable of data sets to be being processed
- definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: start_time (start time)>, <RawDataValueDefinition: end_time (end time)>, <RawDataValueDefinition: duration (duration)>, <RawDataValueDefinition: placement (detected placement)>]#
 
- transform_function(acc_ts_euclidean_norm)#
 Concatenate accelerometer and norm data and call placement function.
- Parameters:
 - Returns:
 contains start time, end time and label of each continuous segment
- Return type:
 
- dispel.providers.generic.activity.placement.ROLLING_STEP_SIZE = '100ms'#
 This is the step of the sliding window, denoting the size of the “sliding” action, which is the length of sequence you move between each window.
- dispel.providers.generic.activity.placement.ROLLING_WINDOW_SIZE = '4s'#
 This is the size of the sliding window, denoting the duration between begin and end of sliding window.
- dispel.providers.generic.activity.placement.THRES_BELT_MIN_ABS_MEAN_GRAVITY_X_1 = 0.6018150231520484#
 [0, 53] deg X axes max.
- Type:
 belt threshold 1
- dispel.providers.generic.activity.placement.THRES_HAND_MAX_MEAN_GRAVITY_Z_1 = -0.6427876096865394#
 [8, 50] (or [18, 50]) deg Z axis max.
- Type:
 handheld threshold 1
- dispel.providers.generic.activity.placement.THRES_PANT_MIN_ABS_MEAN_GRAVITY_Y_1 = 0.7071067811865476#
 [0, 45] deg Y axes max.
- Type:
 pant threshold 1
- dispel.providers.generic.activity.placement.THRES_TABL_MAX_STD_ACC_NORM_1 = 0.01#
 standard deviation of acc norm.
- Type:
 table threshold 1
- dispel.providers.generic.activity.placement.THRES_TABL_MIN_ABS_MEAN_GRAVITY_Z_1 = 0.9510565162951535#
 [0, 18] deg Z axis max (to be combined with low std).
- Type:
 table threshold 1
- dispel.providers.generic.activity.placement.THRES_TABL_MIN_ABS_MEAN_GRAVITY_Z_2 = 0.9902680687415704#
 [0, 8] deg Z axes max.
- Type:
 table threshold 2
- dispel.providers.generic.activity.placement.merge_adjacent_annotations_rolling(measures_predictions, rolling_step_size='100ms')[source]#
 Merge adjacent annotations into segments of continuous labels.
- Parameters:
 - Returns:
 contains start time, end time and label of each continuous segment
- Return type:
 
- dispel.providers.generic.activity.placement.placement_classification(data, rolling_window_size='4s', rolling_step_size='100ms')[source]#
 Extract measures and predict labels given the gravity and norm data.
- Parameters:
 data (DataFrame) – A pd.DataFrame containing the gravity and accelerometer norm data
rolling_window_size (str) – A string containing the size of the sliding window (duration between begin and end of sliding window)
rolling_step_size (str) – A string containing the step of the sliding window (duration between centers of consecutive windows)
- Returns:
 A dataframe containing the extracted measures and label per window
- Return type:
 
- dispel.providers.generic.activity.placement.placement_classification_merged(acc_ts, acc_ts_euclidean_norm)[source]#
 Concatenate accelerometer and norm data and call placement function.
- Parameters:
 - Returns:
 contains start time, end time and label of each continuous segment
- Return type: