paradigma 1.0.3__py3-none-any.whl → 1.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- paradigma/__init__.py +10 -1
- paradigma/classification.py +38 -21
- paradigma/config.py +187 -123
- paradigma/constants.py +48 -35
- paradigma/feature_extraction.py +345 -255
- paradigma/load.py +476 -0
- paradigma/orchestrator.py +670 -0
- paradigma/pipelines/gait_pipeline.py +685 -246
- paradigma/pipelines/pulse_rate_pipeline.py +456 -155
- paradigma/pipelines/pulse_rate_utils.py +289 -248
- paradigma/pipelines/tremor_pipeline.py +405 -132
- paradigma/prepare_data.py +409 -0
- paradigma/preprocessing.py +500 -163
- paradigma/segmenting.py +180 -140
- paradigma/testing.py +370 -178
- paradigma/util.py +190 -101
- paradigma-1.1.0.dist-info/METADATA +229 -0
- paradigma-1.1.0.dist-info/RECORD +26 -0
- {paradigma-1.0.3.dist-info → paradigma-1.1.0.dist-info}/WHEEL +1 -1
- paradigma-1.1.0.dist-info/entry_points.txt +4 -0
- {paradigma-1.0.3.dist-info → paradigma-1.1.0.dist-info/licenses}/LICENSE +0 -1
- paradigma-1.0.3.dist-info/METADATA +0 -138
- paradigma-1.0.3.dist-info/RECORD +0 -22
paradigma/constants.py
CHANGED
|
@@ -2,40 +2,46 @@ from dataclasses import dataclass
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
@dataclass(frozen=True)
|
|
5
|
-
class DataColumns
|
|
5
|
+
class DataColumns:
|
|
6
6
|
"""
|
|
7
7
|
Class containing the data channels in `tsdf`.
|
|
8
8
|
"""
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
|
|
10
|
+
ACCELEROMETER_X: str = "accelerometer_x"
|
|
11
|
+
ACCELEROMETER_Y: str = "accelerometer_y"
|
|
12
|
+
ACCELEROMETER_Z: str = "accelerometer_z"
|
|
13
|
+
GYROSCOPE_X: str = "gyroscope_x"
|
|
14
|
+
GYROSCOPE_Y: str = "gyroscope_y"
|
|
15
|
+
GYROSCOPE_Z: str = "gyroscope_z"
|
|
16
|
+
PPG: str = "green"
|
|
17
|
+
TIME: str = "time"
|
|
18
|
+
GAIT_SEGMENT_NR: str = "gait_segment_nr"
|
|
19
|
+
SEGMENT_NR: str = "gait_segment_nr" # Deprecated: Use GAIT_SEGMENT_NR instead
|
|
20
|
+
DATA_SEGMENT_NR: str = "data_segment_nr"
|
|
18
21
|
SEGMENT_CAT: str = "segment_category"
|
|
19
22
|
|
|
20
|
-
# Gait
|
|
21
|
-
GRAV_ACCELEROMETER_X
|
|
22
|
-
GRAV_ACCELEROMETER_Y
|
|
23
|
-
GRAV_ACCELEROMETER_Z
|
|
23
|
+
# Gait
|
|
24
|
+
GRAV_ACCELEROMETER_X: str = "accelerometer_x_grav"
|
|
25
|
+
GRAV_ACCELEROMETER_Y: str = "accelerometer_y_grav"
|
|
26
|
+
GRAV_ACCELEROMETER_Z: str = "accelerometer_z_grav"
|
|
24
27
|
PRED_GAIT_PROBA: str = "pred_gait_proba"
|
|
25
|
-
PRED_GAIT
|
|
28
|
+
PRED_GAIT: str = "pred_gait"
|
|
26
29
|
PRED_NO_OTHER_ARM_ACTIVITY_PROBA: str = "pred_no_other_arm_activity_proba"
|
|
27
|
-
PRED_NO_OTHER_ARM_ACTIVITY
|
|
28
|
-
ANGLE
|
|
29
|
-
VELOCITY
|
|
30
|
+
PRED_NO_OTHER_ARM_ACTIVITY: str = "pred_no_other_arm_activity"
|
|
31
|
+
ANGLE: str = "angle"
|
|
32
|
+
VELOCITY: str = "velocity"
|
|
30
33
|
DOMINANT_FREQUENCY: str = "dominant_frequency"
|
|
31
34
|
RANGE_OF_MOTION: str = "range_of_motion"
|
|
32
35
|
PEAK_VELOCITY: str = "peak_velocity"
|
|
33
36
|
|
|
34
37
|
# The following are used in tremor analysis
|
|
35
38
|
PRED_TREMOR_PROBA: str = "pred_tremor_proba"
|
|
36
|
-
PRED_TREMOR_LOGREG
|
|
37
|
-
PRED_TREMOR_CHECKED
|
|
39
|
+
PRED_TREMOR_LOGREG: str = "pred_tremor_logreg"
|
|
40
|
+
PRED_TREMOR_CHECKED: str = "pred_tremor_checked"
|
|
38
41
|
PRED_ARM_AT_REST: str = "pred_arm_at_rest"
|
|
42
|
+
TREMOR_POWER: str = "tremor_power"
|
|
43
|
+
BELOW_TREMOR_POWER: str = "below_tremor_power"
|
|
44
|
+
FREQ_PEAK: str = "freq_peak"
|
|
39
45
|
|
|
40
46
|
# Constants for PPG features
|
|
41
47
|
VARIANCE: str = "variance"
|
|
@@ -60,47 +66,54 @@ class DataColumns():
|
|
|
60
66
|
|
|
61
67
|
# Constants for pulse rate
|
|
62
68
|
PULSE_RATE: str = "pulse_rate"
|
|
63
|
-
|
|
69
|
+
|
|
70
|
+
|
|
64
71
|
@dataclass(frozen=True)
|
|
65
|
-
class DataUnits
|
|
72
|
+
class DataUnits:
|
|
66
73
|
"""
|
|
67
74
|
Class containing the data channel unit types in `tsdf`.
|
|
68
75
|
"""
|
|
76
|
+
|
|
69
77
|
ACCELERATION: str = "m/s^2"
|
|
70
78
|
""" The acceleration is in m/s^2. """
|
|
71
|
-
|
|
79
|
+
|
|
72
80
|
ROTATION: str = "deg/s"
|
|
73
81
|
""" The rotation is in degrees per second. """
|
|
74
|
-
|
|
82
|
+
|
|
75
83
|
GRAVITY: str = "g"
|
|
76
84
|
""" The acceleration due to gravity is in g. """
|
|
77
|
-
|
|
78
|
-
|
|
85
|
+
|
|
86
|
+
POWER_SPECTRAL_DENSITY_ACC: str = "g^2/Hz"
|
|
79
87
|
""" The power spectral density is in g^2/Hz. """
|
|
80
|
-
|
|
88
|
+
|
|
89
|
+
POWER_ROTATION: str = "(deg/s)^2"
|
|
90
|
+
""" The power is in "(deg/s)^2. """
|
|
91
|
+
|
|
81
92
|
FREQUENCY: str = "Hz"
|
|
82
93
|
""" The frequency is in Hz. """
|
|
83
94
|
|
|
84
95
|
NONE: str = "none"
|
|
85
96
|
""" The data channel has no unit. """
|
|
86
|
-
|
|
97
|
+
|
|
87
98
|
|
|
88
99
|
@dataclass(frozen=True)
|
|
89
|
-
class TimeUnit
|
|
100
|
+
class TimeUnit:
|
|
90
101
|
"""
|
|
91
102
|
Class containing the `time` channel unit types in `tsdf`.
|
|
92
103
|
"""
|
|
93
|
-
|
|
104
|
+
|
|
105
|
+
RELATIVE_MS: str = "relative_ms"
|
|
94
106
|
""" The time is relative to the start time in milliseconds. """
|
|
95
|
-
RELATIVE_S
|
|
107
|
+
RELATIVE_S: str = "relative_s"
|
|
96
108
|
""" The time is relative to the start time in seconds. """
|
|
97
|
-
ABSOLUTE_MS
|
|
109
|
+
ABSOLUTE_MS: str = "absolute_ms"
|
|
98
110
|
""" The time is absolute in milliseconds. """
|
|
99
|
-
ABSOLUTE_S
|
|
111
|
+
ABSOLUTE_S: str = "absolute_s"
|
|
100
112
|
""" The time is absolute in seconds. """
|
|
101
|
-
DIFFERENCE_MS
|
|
113
|
+
DIFFERENCE_MS: str = "difference_ms"
|
|
102
114
|
""" The time is the difference between consecutive samples in milliseconds. """
|
|
103
|
-
DIFFERENCE_S
|
|
115
|
+
DIFFERENCE_S: str = "difference_s"
|
|
104
116
|
""" The time is the difference between consecutive samples in seconds. """
|
|
105
117
|
|
|
118
|
+
|
|
106
119
|
UNIX_TICKS_MS: int = 1000
|