Update README.md
Browse filesdocs: add complete dataset card with YAML metadata, columns, usage & license
README.md
CHANGED
|
@@ -1,19 +1,33 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
Personal Strava
|
| 4 |
-
|
| 5 |
|
| 6 |
---
|
| 7 |
|
| 8 |
## Files
|
| 9 |
|
| 10 |
| File | Rows | Description |
|
| 11 |
-
|------|-----
|
| 12 |
-
| `strava_master_enhanced.parquet` |
|
| 13 |
-
| `weekly_sport.parquet` |
|
| 14 |
-
| `weekly_category.parquet` |
|
| 15 |
|
| 16 |
-
*(
|
| 17 |
|
| 18 |
---
|
| 19 |
|
|
@@ -21,71 +35,123 @@ Provides per-activity master table and weekly aggregations with intensity metric
|
|
| 21 |
|
| 22 |
| Column | `dtype` | Description |
|
| 23 |
|--------|---------|-------------|
|
| 24 |
-
| `activity_id` | `int64` |
|
| 25 |
-
| `name` | `string` | Activity title on Strava |
|
| 26 |
-
| `sport` | `category` | Sport type (Run
|
| 27 |
-
| `date` | `datetime64[ns]` | Local start time |
|
| 28 |
-
| `distance_km` | `float32` | Distance
|
| 29 |
-
| `elapsed_hr` | `float32` | Elapsed time
|
| 30 |
-
| `moving_hr` | `float32` | Moving time (
|
| 31 |
-
| `elevation_gain_m` | `float32` |
|
| 32 |
-
| `elevation_loss_m` | `float32` |
|
| 33 |
-
| `average_speed_kph` | `float32` | Moving speed (km h
|
| 34 |
-
| `max_speed_kph` | `float32` | Max speed (km h
|
| 35 |
-
| `average_hr` | `float32` | Avg heart-rate (bpm)
|
| 36 |
| `max_hr` | `int16` | Max heart-rate (bpm) |
|
| 37 |
-
| `average_cadence` | `float32` | Avg cadence (rpm)
|
| 38 |
| `max_cadence` | `int16` | Max cadence (rpm) |
|
| 39 |
-
| `
|
| 40 |
-
| `
|
| 41 |
-
| `trimp` | `float32` | Banister TRIMP = `moving_hr × intensity_level × 50` |
|
| 42 |
-
| `pace_min_per_km` | `float32` | Pace (min km-¹); *NaN* for non-run sports |
|
| 43 |
-
| `commute` | `boolean` | Marked as commute on Strava |
|
| 44 |
-
| `gear` | `string` | Bike / Shoes used (if set) |
|
| 45 |
| `calories_kcal` | `float32` | Calories reported by Strava |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
| `weather` | `string` | Weather summary (if available) |
|
| 47 |
-
| `temperature_c` | `float32` | Avg
|
| 48 |
-
| `
|
| 49 |
-
| `
|
| 50 |
-
| `
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
|
| 59 |
---
|
| 60 |
|
| 61 |
## Processing pipeline
|
| 62 |
|
| 63 |
-
1. **
|
| 64 |
-
2. **
|
| 65 |
-
3.
|
| 66 |
-
4. **
|
|
|
|
|
|
|
| 67 |
|
| 68 |
-
|
|
|
|
| 69 |
|
| 70 |
---
|
| 71 |
|
| 72 |
-
## Usage
|
| 73 |
|
| 74 |
```python
|
| 75 |
from datasets import load_dataset
|
| 76 |
-
|
| 77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
df = ds["train"].to_pandas()
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
```
|
| 81 |
|
| 82 |
-
##
|
| 83 |
|
| 84 |
-
|
| 85 |
-
|
|
|
|
| 86 |
|
| 87 |
-
|
| 88 |
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
dataset_name: strava_master_dataset
|
| 3 |
+
pretty_name: Strava Master Dataset
|
| 4 |
+
license: cc-by-nc-4.0
|
| 5 |
+
task_categories:
|
| 6 |
+
- time-series-forecasting # ← ここを修正
|
| 7 |
+
tags:
|
| 8 |
+
- running
|
| 9 |
+
- cycling
|
| 10 |
+
- wearable
|
| 11 |
+
language:
|
| 12 |
+
- en
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# Strava Master Dataset ― Benj-samurai
|
| 16 |
|
| 17 |
+
> **Personal multi-sport training log** exported from Strava (JP CSV) and processed into a clean, analysis-ready Parquet table + weekly summaries.
|
| 18 |
+
> Covers **〔開始日 – 終了日〕**, total **〔活動件数〕 activities** across **〔種目数〕 sports**.
|
| 19 |
|
| 20 |
---
|
| 21 |
|
| 22 |
## Files
|
| 23 |
|
| 24 |
| File | Rows | Description |
|
| 25 |
+
|------|-----:|-------------|
|
| 26 |
+
| `my_strava_dataset/strava_master_enhanced.parquet` | 〔n〕 | Master table — 1 row = 1 activity |
|
| 27 |
+
| `my_strava_dataset/weekly_sport.parquet` | 〔m〕 | Weekly totals by *year–week × sport* |
|
| 28 |
+
| `my_strava_dataset/weekly_category.parquet` | 〔k〕 | Weekly totals by intensity zone |
|
| 29 |
|
| 30 |
+
*(Parquet → compact, schema-aware, loadable via `datasets.load_dataset`)*
|
| 31 |
|
| 32 |
---
|
| 33 |
|
|
|
|
| 35 |
|
| 36 |
| Column | `dtype` | Description |
|
| 37 |
|--------|---------|-------------|
|
| 38 |
+
| `activity_id` | `int64` | Strava Activity ID |
|
| 39 |
+
| `name` | `string` | Activity title as saved on Strava |
|
| 40 |
+
| `sport` | `category` | Sport type (`Run`, `Ride`, `Swim`, `Walk`, …) |
|
| 41 |
+
| `date` | `datetime64[ns]` | Local activity start time |
|
| 42 |
+
| `distance_km` | `float32` | Distance in **kilometres** (raw m → km) |
|
| 43 |
+
| `elapsed_hr` | `float32` | Elapsed time incl. pauses **hours** (raw sec → h) |
|
| 44 |
+
| `moving_hr` | `float32` | Moving time (in-motion) **hours** |
|
| 45 |
+
| `elevation_gain_m` | `float32` | Total positive elevation gain (m) |
|
| 46 |
+
| `elevation_loss_m` | `float32` | Total negative elevation (m) |
|
| 47 |
+
| `average_speed_kph` | `float32` | Moving speed (km h⁻¹) |
|
| 48 |
+
| `max_speed_kph` | `float32` | Max speed (km h⁻¹) |
|
| 49 |
+
| `average_hr` | `float32` | Avg heart-rate (bpm) – *NaN if no sensor* |
|
| 50 |
| `max_hr` | `int16` | Max heart-rate (bpm) |
|
| 51 |
+
| `average_cadence` | `float32` | Avg cadence (rpm) |
|
| 52 |
| `max_cadence` | `int16` | Max cadence (rpm) |
|
| 53 |
+
| `average_power` | `float32` | Avg power (W); bike only |
|
| 54 |
+
| `max_power` | `int16` | Peak power (W) |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
| `calories_kcal` | `float32` | Calories reported by Strava |
|
| 56 |
+
| `training_category` | `category` | HR zone label `Z1-2 / Z3 / Z4 / Z5 / NoHR` |
|
| 57 |
+
| `intensity_level` | `float32` | Avg HR ÷ LTHR (165 bpm) |
|
| 58 |
+
| `trimp` | `float32` | Banister TRIMP (`moving_hr × intensity_level × 50`) |
|
| 59 |
+
| `commute` | `boolean` | Marked as commute on Strava |
|
| 60 |
+
| `filename` | `string` | Original FIT/GPX filename (meta only) |
|
| 61 |
+
| `gear` | `string` | Bike / shoes used (if set) |
|
| 62 |
| `weather` | `string` | Weather summary (if available) |
|
| 63 |
+
| `temperature_c` | `float32` | Avg temp (°C) |
|
| 64 |
+
| `flagged` | `boolean` | Strava flagged activity |
|
| 65 |
+
| `year` | `int16` | Calendar year (`date`). fast grouping |
|
| 66 |
+
| `month` | `int16` | Calendar month (1–12) |
|
| 67 |
+
| `week` | `int16` | ISO week number (1–53) |
|
| 68 |
+
| `year_month` | `string` | `"YYYY-MM"` label for plotting |
|
| 69 |
+
| `week_start` | `datetime64[ns]` | Monday of ISO week (analysis helper) |
|
| 70 |
+
| `sport_weekly_id` | `string` | Composite key `year_week-sport` |
|
| 71 |
+
| `distance_ratio` | `float32` | Share of weekly distance (per sport) |
|
| 72 |
+
| `pace_min_per_km` | `float32` | Pace (min km⁻¹); NaN for non-run |
|
| 73 |
+
| `grade_adjusted_pace` | `float32` | GAP (min km⁻¹); run only |
|
| 74 |
+
| `dirt_distance_km` | `float32` | Unpaved distance (km) |
|
| 75 |
+
| `total_cycles` | `int32` | Swim strokes / pedal revs where available |
|
| 76 |
+
| `route_hash` | `string` | MD5 of polyline (GPS privacy) |
|
| 77 |
+
| `gpx_path` | `string \| None` | Optional GeoJSON path file |
|
| 78 |
+
|
| 79 |
+
> *All numeric distance/time columns are converted to km / hours and stored in
|
| 80 |
+
> low-memory float32/int16 where possible.
|
| 81 |
+
> Empty sensor data are kept as **`NaN`** so they don’t skew means.*
|
| 82 |
|
| 83 |
|
| 84 |
---
|
| 85 |
|
| 86 |
## Processing pipeline
|
| 87 |
|
| 88 |
+
1. **Export**: Strava JP CSV (`activities.csv`)
|
| 89 |
+
2. **Header translation** JP→EN (`translate_headers.py`)
|
| 90 |
+
3. Unit conversion (m→km, s→h) & dtype down-cast (`clean_master.ipynb`)
|
| 91 |
+
4. **Intensity & TRIMP**: LTHR = 165 bpm, Banister formula
|
| 92 |
+
5. Weekly aggregations (`weekly_summary.ipynb`)
|
| 93 |
+
6. Saved as Parquet, tracked via **Git LFS** (compact & diff-friendly)
|
| 94 |
|
| 95 |
+
Code & notebooks live in the companion GitHub repo:
|
| 96 |
+
<https://github.com/Benj-samurai/Strava-Dataset-PRJ>
|
| 97 |
|
| 98 |
---
|
| 99 |
|
| 100 |
+
## Usage ✨
|
| 101 |
|
| 102 |
```python
|
| 103 |
from datasets import load_dataset
|
| 104 |
+
|
| 105 |
+
ds = load_dataset(
|
| 106 |
+
"Benj-samurai/strava_dataset",
|
| 107 |
+
data_files="my_strava_dataset/strava_master_enhanced.parquet",
|
| 108 |
+
streaming=False, # True = stream without download
|
| 109 |
+
)
|
| 110 |
df = ds["train"].to_pandas()
|
| 111 |
+
|
| 112 |
+
# quick EDA
|
| 113 |
+
weekly_km = (
|
| 114 |
+
df.assign(year_week=df["date"].dt.to_period("W"))
|
| 115 |
+
.groupby(["year_week", "sport"])["distance_km"].sum()
|
| 116 |
+
)
|
| 117 |
+
print(weekly_km.tail())
|
| 118 |
+
```
|
| 119 |
+
|
| 120 |
+
## Privacy & Personal-use License
|
| 121 |
+
|
| 122 |
+
- **Raw FIT/GPX files are _not_ included.**
|
| 123 |
+
- **Activity start coordinates are jittered ≥ 200 m** to obscure the true home location.
|
| 124 |
+
- Released under **CC BY-NC 4.0** – non-commercial use, attribution required.
|
| 125 |
+
If you wish to use the data commercially, please contact the author first.
|
| 126 |
+
|
| 127 |
+
---
|
| 128 |
+
|
| 129 |
+
## Citation
|
| 130 |
+
|
| 131 |
+
```bibtex
|
| 132 |
+
@misc{asai2025strava,
|
| 133 |
+
author = {Asai, Benj-samurai},
|
| 134 |
+
title = {Strava Master Dataset},
|
| 135 |
+
year = {2025},
|
| 136 |
+
howpublished = {\url{https://huggingface.co/datasets/Benj-samurai/strava_dataset}},
|
| 137 |
+
note = {Version {{\today}}}
|
| 138 |
+
}
|
| 139 |
```
|
| 140 |
|
| 141 |
+
## Changelog
|
| 142 |
|
| 143 |
+
| Date | Version | Notes |
|
| 144 |
+
|------------|---------|--------------------------|
|
| 145 |
+
| 2025-05-06 | v1.0 | Initial public release |
|
| 146 |
|
| 147 |
+
---
|
| 148 |
|
| 149 |
+
### 使い方
|
| 150 |
+
|
| 151 |
+
1. HF Hub ページの **Dataset card** タブ → **Edit** を開く
|
| 152 |
+
2. 上の Markdown を貼り付ける
|
| 153 |
+
3. 〔 〕部分を実際の値に置換して **Commit**
|
| 154 |
+
*行数* は手元で `len(df)`、週レコードは `len(weekly_sport)` などで確認できます。
|
| 155 |
+
|
| 156 |
+
これで “列定義・処理手順・使用例・ライセンス” を網羅したリッチな Dataset Card になります。
|
| 157 |
+
追記やレイアウト調整はお好みでどうぞ!
|