rricc22 commited on
Commit
c0b0ecd
·
verified ·
1 Parent(s): 4241a90

Upload README.md (Parquet format for HF viewer)

Browse files
Files changed (1) hide show
  1. README.md +92 -258
README.md CHANGED
@@ -1,304 +1,138 @@
1
  ---
2
  license: mit
3
  task_categories:
4
- - time-series-forecasting
5
- language:
6
- - en
7
  tags:
8
- - heart-rate-prediction
9
- - running
10
- - sports-science
11
- - physiological-modeling
12
- - endomondo
13
  size_categories:
14
- - 10K<n<100K
15
  ---
16
 
17
- # Heart Rate Prediction Dataset (Endomondo V2)
18
 
19
- Clean, preprocessed dataset for predicting heart rate from running workout data (speed and altitude).
20
 
21
- ## Dataset Description
22
 
23
- This dataset contains **40,186 running workouts** from the Endomondo fitness tracking platform, quality-filtered and smoothed for heart rate prediction using machine learning.
 
 
 
24
 
25
- ### Dataset Statistics
26
 
27
- - **Total Workouts**: 40,186
28
- - **Total Users**: 761 unique runners
29
- - **Sport**: Running only
30
- - **Format**: JSON (single file with all workouts)
31
- - **File Size**: 1.4 GB
32
 
33
- ### Workout Types Distribution
 
 
 
 
34
 
35
- | Type | Count | Description |
36
- |------|-------|-------------|
37
- | RECOVERY | 15,095 | Easy pace runs (HR mean < 120 BPM) |
38
- | STEADY | 22,991 | Constant moderate pace |
39
- | INTENSIVE | 2,100 | High intensity workouts |
40
-
41
- ## Data Format
42
-
43
- The dataset is a single JSON file with the following structure:
44
-
45
- ```json
46
- {
47
- "metadata": {
48
- "timestamp": "2026-01-14T15:07:10",
49
- "original_count": 46250,
50
- "final_count": 40186,
51
- "removed": {
52
- "flagged_samples": 5830,
53
- "total_removed": 6064
54
- },
55
- "workout_type_counts": {...},
56
- "flags_applied": [...],
57
- "smoothing_inherited": {...}
58
- },
59
- "workouts": [
60
- {
61
- "workout_id": 296982347,
62
- "user_id": 4969375,
63
- "sport": "run",
64
- "workout_type": "RECOVERY|STEADY|INTENSIVE",
65
- "duration_min": 108.38,
66
- "data_points": 500,
67
- "heart_rate": [103.0, 105.2, ...], // BPM values
68
- "speed": [8.89, 9.12, ...], // km/h
69
- "altitude": [34.85, 35.2, ...], // meters
70
- "timestamp": [1392480163, ...], // Unix timestamps
71
- "hr_mean": 134.9,
72
- "hr_std": 10.3,
73
- "hr_min": 75,
74
- "hr_max": 163,
75
- "speed_source": "GPS_computed",
76
- "speed_metrics": {...},
77
- "workout_type_onehot": {
78
- "RECOVERY": 1,
79
- "STEADY": 0,
80
- "INTENSIVE": 0
81
- }
82
- },
83
- ...
84
- ]
85
- }
86
- ```
87
-
88
- ### Fields Description
89
-
90
- **Workout Metadata**:
91
- - `workout_id`: Unique identifier from Endomondo
92
- - `user_id`: Anonymized user ID
93
- - `sport`: Always "run" in this dataset
94
- - `workout_type`: Categorized as RECOVERY, STEADY, or INTENSIVE
95
- - `duration_min`: Total workout duration in minutes
96
- - `data_points`: Number of timesteps (typically 500, ~6 seconds per point)
97
-
98
- **Time Series Data** (arrays of equal length):
99
- - `heart_rate`: Heart rate in BPM
100
- - `speed`: Running speed in km/h (computed from GPS when missing)
101
- - `altitude`: Elevation in meters
102
- - `timestamp`: Unix timestamps
103
-
104
- **Statistics**:
105
- - `hr_mean`, `hr_std`, `hr_min`, `hr_max`: Heart rate statistics
106
- - `speed_metrics`: Speed data quality and statistics
107
- - `workout_type_onehot`: One-hot encoding for workout type
108
-
109
- ## Data Quality & Preprocessing
110
 
111
- ### Quality Filtering
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
 
113
- Workouts were removed if they had:
114
- - Mean HR < 50 BPM or > 200 BPM (unrealistic)
115
- - HR std < 5 BPM (too constant, likely sensor error)
116
- - Negative HR-speed correlation < -0.3 (physiologically impossible)
117
- - Excessive missing data points
118
 
119
- **Total removed**: 6,064 workouts (13.1% of original dataset)
120
-
121
- ### Preprocessing Pipeline
122
-
123
- 1. **Speed Computation**:
124
- - Calculated from GPS coordinates using haversine distance
125
- - Filled missing speed values from original dataset
126
- - Outliers above 25 km/h flagged and smoothed
127
-
128
- 2. **Smoothing**:
129
- - Applied 7-point moving average to heart_rate, speed, and altitude
130
- - Reduces sensor noise while preserving workout patterns
131
- - Edge cases handled with reflection padding
132
-
133
- 3. **Workout Type Classification**:
134
- - **RECOVERY**: HR mean < 120 BPM
135
- - **INTENSIVE**: HR mean > 165 BPM OR HR max > 200 BPM
136
- - **STEADY**: All others (moderate, consistent effort)
137
-
138
- ## Usage
139
-
140
- ### Loading the Dataset
141
-
142
- ```python
143
- import json
144
- from huggingface_hub import hf_hub_download
145
-
146
- # Download file
147
- dataset_path = hf_hub_download(
148
- repo_id="rricc22/endomondo-hr-prediction-v2",
149
- filename="clean_dataset_v2.json",
150
- repo_type="dataset"
151
- )
152
-
153
- # Load data
154
- with open(dataset_path, 'r') as f:
155
- data = json.load(f)
156
-
157
- # Access workouts
158
- workouts = data['workouts']
159
- metadata = data['metadata']
160
-
161
- print(f"Total workouts: {len(workouts)}")
162
- print(f"First workout ID: {workouts[0]['workout_id']}")
163
- ```
164
 
165
- ### Example: Filter by Workout Type
166
 
167
- ```python
168
- # Get all intensive workouts
169
- intensive = [w for w in workouts if w['workout_type'] == 'INTENSIVE']
 
 
 
 
 
170
 
171
- print(f"Intensive workouts: {len(intensive)}")
172
- ```
173
 
174
- ### Example: Train/Val/Test Split
175
 
176
  ```python
177
- import numpy as np
178
-
179
- # Get unique users
180
- users = list(set(w['user_id'] for w in workouts))
181
- np.random.seed(42)
182
- np.random.shuffle(users)
183
 
184
- # Split users 70/15/15
185
- n_train = int(0.7 * len(users))
186
- n_val = int(0.15 * len(users))
187
 
188
- train_users = set(users[:n_train])
189
- val_users = set(users[n_train:n_train+n_val])
190
- test_users = set(users[n_train+n_val:])
191
 
192
- # Split workouts by user
193
- train_workouts = [w for w in workouts if w['user_id'] in train_users]
194
- val_workouts = [w for w in workouts if w['user_id'] in val_users]
195
- test_workouts = [w for w in workouts if w['user_id'] in test_users]
 
 
196
 
197
- print(f"Train: {len(train_workouts)} workouts from {len(train_users)} users")
198
- print(f"Val: {len(val_workouts)} workouts from {len(val_users)} users")
199
- print(f"Test: {len(test_workouts)} workouts from {len(test_users)} users")
200
- ```
201
-
202
- ### Example: Extract Features for ML
203
-
204
- ```python
205
- import numpy as np
206
-
207
- def extract_features(workout):
208
- """Extract input features and target for a single workout."""
209
- # Input features
210
- speed = np.array(workout['speed'])
211
- altitude = np.array(workout['altitude'])
212
- gender = 1 if workout.get('gender', 'Male') == 'Male' else 0
213
-
214
- # Target
215
- heart_rate = np.array(workout['heart_rate'])
216
-
217
- return {
218
- 'speed': speed,
219
- 'altitude': altitude,
220
- 'gender': gender,
221
- 'heart_rate': heart_rate,
222
- 'length': workout['data_points']
223
- }
224
-
225
- # Extract features for all workouts
226
- features = [extract_features(w) for w in workouts]
227
  ```
228
 
229
  ## Model Performance
230
 
231
- A 2-layer LSTM model trained on this dataset achieved:
232
- - **MAE**: 7.42 BPM on test set
233
- - **RMSE**: 9.54 BPM
234
-
235
- **Trained Model**: [heart-rate-prediction-lstm](https://huggingface.co/rricc22/heart-rate-prediction-lstm)
236
- **Interactive Demo**: [Heart Rate Predictor](https://huggingface.co/spaces/rricc22/heart-rate-predictor)
237
 
238
- ## Intended Use
239
 
240
- ### Primary Use Cases
241
- - Training machine learning models for heart rate prediction
242
- - Research on physiological response modeling during exercise
243
- - Time-series forecasting benchmarking
244
- - Sports science and exercise physiology studies
245
 
246
- ### Out-of-Scope
247
- - Medical diagnosis or treatment decisions
248
- - Non-running activities (cycling, swimming, etc.)
249
- - Real-time monitoring applications
250
 
251
- ## Limitations
252
-
253
- 1. **Population**: Primarily European recreational runners from Endomondo platform (2014-2016 era)
254
- 2. **Device Variability**: Mixed GPS accuracy and heart rate sensor quality
255
- 3. **Speed Range**: Most data in 8-15 km/h range (marathon training pace)
256
- 4. **Missing Demographics**: Only user_id available, no age/weight/fitness level
257
- 5. **Environmental Factors**: No temperature, humidity, wind, or terrain type data
258
-
259
- ## Ethical Considerations
260
-
261
- - **Privacy**: Original Endomondo public dataset (users consented to data sharing)
262
- - **Anonymization**: No personally identifiable information (user IDs anonymized)
263
- - **Not Medical**: For research and training optimization only, not medical use
264
- - **Bias**: Model trained on this data may not generalize to all populations or fitness levels
265
 
266
  ## Citation
267
 
268
  If you use this dataset, please cite:
269
 
270
  ```bibtex
271
- @dataset{endomondo_hr_v2_2026,
272
- author = {Riccardo},
273
- title = {Heart Rate Prediction Dataset (Endomondo V2)},
274
- year = {2026},
275
- publisher = {Hugging Face},
276
- url = {https://huggingface.co/datasets/rricc22/endomondo-hr-prediction-v2}
277
- }
278
- ```
279
-
280
- **Original Endomondo Dataset**:
281
- ```bibtex
282
- @article{endomondo2016,
283
- title={The Endomondo dataset},
284
- author={Gjoreski, Martin and others},
285
- journal={Available online},
286
- year={2016}
287
  }
288
  ```
289
 
290
- ## License
291
-
292
- MIT License - See LICENSE file for details
293
-
294
  ## Related Resources
295
 
296
- - **Model**: [heart-rate-prediction-lstm](https://huggingface.co/rricc22/heart-rate-prediction-lstm) - 2-layer LSTM (7.42 BPM MAE)
297
- - **Demo**: [Heart Rate Predictor](https://huggingface.co/spaces/rricc22/heart-rate-predictor) - Interactive Streamlit app
298
- - **Original Dataset**: Endomondo HR public dataset
299
-
300
- ---
301
-
302
- **Created**: January 14, 2026
303
- **Version**: 2.0
304
- **Contact**: For questions or issues, please open an issue on the dataset repository.
 
1
  ---
2
  license: mit
3
  task_categories:
4
+ - time-series-forecasting
 
 
5
  tags:
6
+ - heart-rate
7
+ - running
8
+ - physiological-modeling
9
+ - lstm
10
+ - endomondo
11
  size_categories:
12
+ - 10K<n<100K
13
  ---
14
 
15
+ # Endomondo Heart Rate Prediction Dataset V2
16
 
17
+ ## Dataset Summary
18
 
19
+ This dataset contains **40,186 running workouts** from **761** athletes, designed for heart rate prediction from speed and altitude time-series.
20
 
21
+ Each workout includes:
22
+ - **Time-series**: Heart rate (target), speed, altitude, timestamps
23
+ - **Metadata**: Workout type, duration, user ID
24
+ - **Statistics**: Pre-computed HR/speed metrics for filtering
25
 
26
+ ## Dataset Structure
27
 
28
+ ### Splits
 
 
 
 
29
 
30
+ | Split | Workouts | Description |
31
+ |-------|----------|-------------|
32
+ | Train | 28,130 | Training set (70%) |
33
+ | Validation | 6,027 | Validation set (15%) |
34
+ | Test | 6,029 | Test set (15%) |
35
 
36
+ ### Features
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
+ | Feature | Type | Description |
39
+ |---------|------|-------------|
40
+ | `workout_id` | int | Unique workout identifier |
41
+ | `user_id` | int | Anonymous user identifier |
42
+ | `workout_type` | string | RECOVERY, STEADY, or INTENSIVE |
43
+ | `duration_min` | float | Workout duration in minutes |
44
+ | `data_points` | int | Number of timesteps (max 500) |
45
+ | `heart_rate` | list[float] | Heart rate time-series [BPM] |
46
+ | `speed` | list[float] | Speed time-series [km/h] |
47
+ | `altitude` | list[float] | Altitude time-series [meters] |
48
+ | `timestamp` | list[float] | Unix timestamps [seconds] |
49
+ | `hr_mean` | float | Average heart rate [BPM] |
50
+ | `hr_std` | float | HR standard deviation |
51
+ | `hr_min` | float | Minimum HR [BPM] |
52
+ | `hr_max` | float | Maximum HR [BPM] |
53
+ | `speed_mean` | float | Average speed [km/h] |
54
+ | `speed_max` | float | Maximum speed [km/h] |
55
+ | `altitude_gain` | float | Cumulative elevation gain [m] |
56
+ | `split` | string | train / validation / test |
57
 
58
+ ### Workout Type Distribution
 
 
 
 
59
 
60
+ | Type | Count | Description |
61
+ |------|-------|-------------|
62
+ | RECOVERY | 15,095 | Easy runs (low intensity) |
63
+ | STEADY | 22,991 | Moderate pace runs |
64
+ | INTENSIVE | 2,100 | High intensity workouts |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
+ ## Data Quality
67
 
68
+ All workouts have been:
69
+ 1. **Filtered** for quality (removed HR anomalies, corrupted data)
70
+ 2. **Smoothed** with 7-point moving average (reduces GPS noise)
71
+ 3. **Validated** against physiological constraints:
72
+ - HR mean ≥ 120 BPM
73
+ - HR max ≤ 200 BPM
74
+ - HR std ≥ 5 BPM
75
+ - Speed-HR correlation ≥ -0.3
76
 
77
+ Removed: 6,064 low-quality workouts
 
78
 
79
+ ## Usage Example
80
 
81
  ```python
82
+ from datasets import load_dataset
 
 
 
 
 
83
 
84
+ # Load full dataset
85
+ dataset = load_dataset("rricc22/endomondo-hr-prediction-v2")
 
86
 
87
+ # Access splits
88
+ train_data = dataset['train']
89
+ test_data = dataset['test']
90
 
91
+ # Example workout
92
+ workout = train_data[0]
93
+ print(f"Workout Type: {workout['workout_type']}")
94
+ print(f"Duration: {workout['duration_min']:.1f} min")
95
+ print(f"Avg HR: {workout['hr_mean']:.1f} BPM")
96
+ print(f"Avg Speed: {workout['speed_mean']:.1f} km/h")
97
 
98
+ # Access time-series
99
+ heart_rate = workout['heart_rate'] # List of HR values
100
+ speed = workout['speed'] # List of speed values
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  ```
102
 
103
  ## Model Performance
104
 
105
+ This dataset was used to train an LSTM model achieving:
106
+ - **7.42 BPM** Mean Absolute Error
107
+ - **17% improvement** over baseline
 
 
 
108
 
109
+ See the model card: [rricc22/heart-rate-prediction-lstm](https://huggingface.co/rricc22/heart-rate-prediction-lstm)
110
 
111
+ Try the demo: [Heart Rate Predictor](https://huggingface.co/spaces/rricc22/heart-rate-predictor)
 
 
 
 
112
 
113
+ ## Source
 
 
 
114
 
115
+ - **Original Data**: Endomondo dataset
116
+ - **Processing Pipeline**: Quality filtering → Smoothing → Feature engineering
117
+ - **Version**: V2 (January 2026)
118
+ - **License**: MIT
 
 
 
 
 
 
 
 
 
 
119
 
120
  ## Citation
121
 
122
  If you use this dataset, please cite:
123
 
124
  ```bibtex
125
+ @dataset{endomondo_hr_v2,
126
+ title={Endomondo Heart Rate Prediction Dataset V2},
127
+ author={Riccardo},
128
+ year={2026},
129
+ publisher={Hugging Face},
130
+ url={https://huggingface.co/datasets/rricc22/endomondo-hr-prediction-v2}
 
 
 
 
 
 
 
 
 
 
131
  }
132
  ```
133
 
 
 
 
 
134
  ## Related Resources
135
 
136
+ - 🤗 **Model**: [heart-rate-prediction-lstm](https://huggingface.co/rricc22/heart-rate-prediction-lstm)
137
+ - 🚀 **Demo**: [Interactive Predictor](https://huggingface.co/spaces/rricc22/heart-rate-predictor)
138
+ - 📊 **GitHub**: [SUB3_V2 Repository](https://github.com/rricc22/SUB3_V2)