|
|
--- |
|
|
dataset_name: strava_master_dataset |
|
|
pretty_name: Strava Master Dataset |
|
|
license: cc-by-nc-4.0 |
|
|
task_categories: |
|
|
- time-series-forecasting |
|
|
tags: |
|
|
- running |
|
|
- cycling |
|
|
- wearable |
|
|
language: |
|
|
- en |
|
|
--- |
|
|
|
|
|
# Strava Master Dataset ― Benj-samurai |
|
|
|
|
|
> **Personal multi-sport training log** exported from Strava (JP CSV) and processed into a clean, analysis-ready Parquet table + weekly summaries. |
|
|
> Covers **〔開始日 – 終了日〕**, total **〔活動件数〕 activities** across **〔種目数〕 sports**. |
|
|
|
|
|
--- |
|
|
|
|
|
## Files |
|
|
|
|
|
| File | Rows | Description | |
|
|
|------|-----:|-------------| |
|
|
| `my_strava_dataset/strava_master_enhanced.parquet` | 〔n〕 | Master table — 1 row = 1 activity | |
|
|
| `my_strava_dataset/weekly_sport.parquet` | 〔m〕 | Weekly totals by *year–week × sport* | |
|
|
| `my_strava_dataset/weekly_category.parquet` | 〔k〕 | Weekly totals by intensity zone | |
|
|
|
|
|
*(Parquet → compact, schema-aware, loadable via `datasets.load_dataset`)* |
|
|
|
|
|
--- |
|
|
|
|
|
## Column definitions (master) |
|
|
|
|
|
| Column | `dtype` | Description | |
|
|
|--------|---------|-------------| |
|
|
| `activity_id` | `int64` | Strava Activity ID | |
|
|
| `name` | `string` | Activity title as saved on Strava | |
|
|
| `sport` | `category` | Sport type (`Run`, `Ride`, `Swim`, `Walk`, …) | |
|
|
| `date` | `datetime64[ns]` | Local activity start time | |
|
|
| `distance_km` | `float32` | Distance in **kilometres** (raw m → km) | |
|
|
| `elapsed_hr` | `float32` | Elapsed time incl. pauses **hours** (raw sec → h) | |
|
|
| `moving_hr` | `float32` | Moving time (in-motion) **hours** | |
|
|
| `elevation_gain_m` | `float32` | Total positive elevation gain (m) | |
|
|
| `elevation_loss_m` | `float32` | Total negative elevation (m) | |
|
|
| `average_speed_kph` | `float32` | Moving speed (km h⁻¹) | |
|
|
| `max_speed_kph` | `float32` | Max speed (km h⁻¹) | |
|
|
| `average_hr` | `float32` | Avg heart-rate (bpm) – *NaN if no sensor* | |
|
|
| `max_hr` | `int16` | Max heart-rate (bpm) | |
|
|
| `average_cadence` | `float32` | Avg cadence (rpm) | |
|
|
| `max_cadence` | `int16` | Max cadence (rpm) | |
|
|
| `average_power` | `float32` | Avg power (W); bike only | |
|
|
| `max_power` | `int16` | Peak power (W) | |
|
|
| `calories_kcal` | `float32` | Calories reported by Strava | |
|
|
| `training_category` | `category` | HR zone label `Z1-2 / Z3 / Z4 / Z5 / NoHR` | |
|
|
| `intensity_level` | `float32` | Avg HR ÷ LTHR (165 bpm) | |
|
|
| `trimp` | `float32` | Banister TRIMP (`moving_hr × intensity_level × 50`) | |
|
|
| `commute` | `boolean` | Marked as commute on Strava | |
|
|
| `filename` | `string` | Original FIT/GPX filename (meta only) | |
|
|
| `gear` | `string` | Bike / shoes used (if set) | |
|
|
| `weather` | `string` | Weather summary (if available) | |
|
|
| `temperature_c` | `float32` | Avg temp (°C) | |
|
|
| `flagged` | `boolean` | Strava flagged activity | |
|
|
| `year` | `int16` | Calendar year (`date`). fast grouping | |
|
|
| `month` | `int16` | Calendar month (1–12) | |
|
|
| `week` | `int16` | ISO week number (1–53) | |
|
|
| `year_month` | `string` | `"YYYY-MM"` label for plotting | |
|
|
| `week_start` | `datetime64[ns]` | Monday of ISO week (analysis helper) | |
|
|
| `sport_weekly_id` | `string` | Composite key `year_week-sport` | |
|
|
| `distance_ratio` | `float32` | Share of weekly distance (per sport) | |
|
|
| `pace_min_per_km` | `float32` | Pace (min km⁻¹); NaN for non-run | |
|
|
| `grade_adjusted_pace` | `float32` | GAP (min km⁻¹); run only | |
|
|
| `dirt_distance_km` | `float32` | Unpaved distance (km) | |
|
|
| `total_cycles` | `int32` | Swim strokes / pedal revs where available | |
|
|
| `route_hash` | `string` | MD5 of polyline (GPS privacy) | |
|
|
| `gpx_path` | `string \| None` | Optional GeoJSON path file | |
|
|
|
|
|
> *All numeric distance/time columns are converted to km / hours and stored in |
|
|
> low-memory float32/int16 where possible. |
|
|
> Empty sensor data are kept as **`NaN`** so they don’t skew means.* |
|
|
|
|
|
|
|
|
--- |
|
|
|
|
|
## Processing pipeline |
|
|
|
|
|
1. **Export**: Strava JP CSV (`activities.csv`) |
|
|
2. **Header translation** JP→EN (`translate_headers.py`) |
|
|
3. Unit conversion (m→km, s→h) & dtype down-cast (`clean_master.ipynb`) |
|
|
4. **Intensity & TRIMP**: LTHR = 165 bpm, Banister formula |
|
|
5. Weekly aggregations (`weekly_summary.ipynb`) |
|
|
6. Saved as Parquet, tracked via **Git LFS** (compact & diff-friendly) |
|
|
|
|
|
Code & notebooks live in the companion GitHub repo: |
|
|
<https://github.com/Benj-samurai/Strava-Dataset-PRJ> |
|
|
|
|
|
--- |
|
|
|
|
|
## Usage ✨ |
|
|
|
|
|
```python |
|
|
from datasets import load_dataset |
|
|
|
|
|
ds = load_dataset( |
|
|
"Benj-samurai/strava_dataset", |
|
|
data_files="my_strava_dataset/strava_master_enhanced.parquet", |
|
|
streaming=False, # True = stream without download |
|
|
) |
|
|
df = ds["train"].to_pandas() |
|
|
|
|
|
# quick EDA |
|
|
weekly_km = ( |
|
|
df.assign(year_week=df["date"].dt.to_period("W")) |
|
|
.groupby(["year_week", "sport"])["distance_km"].sum() |
|
|
) |
|
|
print(weekly_km.tail()) |
|
|
``` |
|
|
|
|
|
## Privacy & Personal-use License |
|
|
|
|
|
- **Raw FIT/GPX files are _not_ included.** |
|
|
- **Activity start coordinates are jittered ≥ 200 m** to obscure the true home location. |
|
|
- Released under **CC BY-NC 4.0** – non-commercial use, attribution required. |
|
|
If you wish to use the data commercially, please contact the author first. |
|
|
|
|
|
--- |
|
|
|
|
|
## Citation |
|
|
|
|
|
```bibtex |
|
|
@misc{asai2025strava, |
|
|
author = {Asai, Benj-samurai}, |
|
|
title = {Strava Master Dataset}, |
|
|
year = {2025}, |
|
|
howpublished = {\url{https://huggingface.co/datasets/Benj-samurai/strava_dataset}}, |
|
|
note = {Version {{\today}}} |
|
|
} |
|
|
``` |
|
|
|
|
|
## Changelog |
|
|
|
|
|
| Date | Version | Notes | |
|
|
|------------|---------|--------------------------| |
|
|
| 2025-05-06 | v1.0 | Initial public release | |
|
|
|
|
|
--- |
|
|
|
|
|
### 使い方 |
|
|
|
|
|
1. HF Hub ページの **Dataset card** タブ → **Edit** を開く |
|
|
2. 上の Markdown を貼り付ける |
|
|
3. 〔 〕部分を実際の値に置換して **Commit** |
|
|
*行数* は手元で `len(df)`、週レコードは `len(weekly_sport)` などで確認できます。 |
|
|
|
|
|
これで “列定義・処理手順・使用例・ライセンス” を網羅したリッチな Dataset Card になります。 |
|
|
追記やレイアウト調整はお好みでどうぞ! |
|
|
|