# Tutorial CS-5: Phone in a pocket: walk, jog, or run?

Profile, clean and window eight phone accelerometer logs (Part 1), then classify walk, jog and run for a person the model has never seen, against the majority-class baseline, with balancing applied to the training rows only (Part 2).

Address: https://apopt.com/data/tutorials/cs05-walk-jog-run/  
License: CC BY 4.0  
Prepared: 2026-12-03

## Description

Files for the tutorial *Phone in a pocket: walk, jog, or run?* (https://apopt.com/course/tutorials/cs05-walk-jog-run/). `raw/` holds the inputs as the device or app wrote them; `clean/` holds the cleaned copies the tutorial writes; `expected/` holds what a correct run prints and saves, so you can check your own run.

## Files

| file | size | rows | description |
|---|---|---|---|
| [clean/change_log.csv](https://apopt.com/data/tutorials/cs05-walk-jog-run/clean/change_log.csv) | 83 B | 2 rows | Cleaned copy written by the tutorial |
| [clean/samples_clean.csv](https://apopt.com/data/tutorials/cs05-walk-jog-run/clean/samples_clean.csv) | 1.2 MB | 73,150 rows | Cleaned copy written by the tutorial |
| [clean/windows.csv](https://apopt.com/data/tutorials/cs05-walk-jog-run/clean/windows.csv) | 6.0 KB | 289 rows | Cleaned copy written by the tutorial |
| [clean/windows_features.csv](https://apopt.com/data/tutorials/cs05-walk-jog-run/clean/windows_features.csv) | 9.4 KB | 289 rows | Cleaned copy written by the tutorial |
| [expected/printed-output.txt](https://apopt.com/data/tutorials/cs05-walk-jog-run/expected/printed-output.txt) | 3.0 KB |  | Everything the tutorial prints, cell by cell |
| [raw/diary.csv](https://apopt.com/data/tutorials/cs05-walk-jog-run/raw/diary.csv) | 651 B | 56 rows | the start of each part of each session (stand, walk, jog, run), in whole seconds, as the person wrote it (SYNTHETIC) |
| [raw/phone_P1.csv](https://apopt.com/data/tutorials/cs05-walk-jog-run/raw/phone_P1.csv) | 375.0 KB | 9,350 rows | one of eight SYNTHETIC phone accelerometer logs (P1 to P8), about three minutes at about 50 samples a second; time in ns, x, y, z in m/s² along the phone's axes |
| [raw/phone_P2.csv](https://apopt.com/data/tutorials/cs05-walk-jog-run/raw/phone_P2.csv) | 351.4 KB | 8,930 rows | Input file the tutorial opens |
| [raw/phone_P3.csv](https://apopt.com/data/tutorials/cs05-walk-jog-run/raw/phone_P3.csv) | 329.2 KB | 8,550 rows | Input file the tutorial opens |
| [raw/phone_P4.csv](https://apopt.com/data/tutorials/cs05-walk-jog-run/raw/phone_P4.csv) | 347.3 KB | 9,100 rows | Input file the tutorial opens |
| [raw/phone_P5.csv](https://apopt.com/data/tutorials/cs05-walk-jog-run/raw/phone_P5.csv) | 354.9 KB | 9,250 rows | Input file the tutorial opens |
| [raw/phone_P6.csv](https://apopt.com/data/tutorials/cs05-walk-jog-run/raw/phone_P6.csv) | 363.6 KB | 9,250 rows | Input file the tutorial opens |
| [raw/phone_P7.csv](https://apopt.com/data/tutorials/cs05-walk-jog-run/raw/phone_P7.csv) | 354.6 KB | 9,150 rows | Input file the tutorial opens |
| [raw/phone_P8.csv](https://apopt.com/data/tutorials/cs05-walk-jog-run/raw/phone_P8.csv) | 360.1 KB | 9,600 rows | Input file the tutorial opens |

Large files are stated with their size. A `preview.md` in this folder shows the first rows of each table.

## Columns

| column | unit | meaning |
|---|---|---|
| time | ns since 1970 (UTC) | sample time |
| x, y, z | m/s² | acceleration along the phone's own axes |
| person | text | who carried the phone (diary) |
| start_s | s from the start of the log | second the part began |
| activity | text | what the person was doing |

## Provenance

- Source: Data-Driven Athletics tutorials (IRSRI, 2027): synthetic phone accelerometer logs and diary made by prepare.py; no real person
- Removed: nothing; the data are synthetic
- Permission basis: Published with the course under CC BY 4.0
- Prepared with: dda/tutorials/build.py

## Used in

- Book: [Chapter 4: Athlete Data in Python](https://apopt.com/book/ch04-python/)
- Course: [Week 4 lesson](https://apopt.com/course/week/4/)
- Homework H08: [https://apopt.com/course/assess/h08/](https://apopt.com/course/assess/h08/)
- Homework H12: [https://apopt.com/course/assess/h12/](https://apopt.com/course/assess/h12/)

## How to cite

Tutorial CS-5: Phone in a pocket: walk, jog, or run?. IRSRI Sports Research Institute, 2026. Data-Driven Athletics data repository. https://apopt.com/data/tutorials/cs05-walk-jog-run/

## Load it

```python
import pandas as pd
df = pd.read_csv("https://apopt.com/data/tutorials/cs05-walk-jog-run/raw/diary.csv")
```
