Jack Noble Résumé
Back to Project Lab

Project Lab / Synthetic data

Training log matcher

Explore how a workout recorded after midnight can leave a planned session uncertain.

Jack Noble · Python implementation and product design · Browser demonstration

Inspect the example

All records are synthetic. Try changing activity 2 from 00:30 to 04:00, or move it to the planned date. Run matching to compare the result. Inputs stay in this tab's memory.

JavaScript is required to run the matcher. Inspect the synthetic inputs and expected result below, or run the linked Python example locally.

Fictional activity and plan inputs

Synthetic activity 2
Inspect the other five activity records
Synthetic activity 1
Synthetic activity 3
Synthetic activity 4
Synthetic activity 5
Synthetic activity 6
Synthetic planned session 1
Synthetic planned session 2

Expected fixture result shown alongside the inputs.

Matching results

Pre-race runs
4
Training miles
29.0
Race miles
50.0

Expected result for the original synthetic fixture.

Uncertain / October 2, 2025

A next-day run at 00:30 occurs before 04:00. Review whether it belongs to the October 2 planned session.

Matched / October 15, 2025

A run exists on the planned date.

Unmatched activity dates

October 1 and November 5 have no eligible same-date or overnight plan. The ride and race are excluded from training totals.

Method and limitations

How the matching rule works

A completed planned session with positive mileage matches when any run occurs on the same calendar date. If no same-date run exists, a run on the next day before 04:00 is flagged as uncertain. At 04:00 it falls outside the rule. Distance similarity is not a matching criterion. A record can be a candidate for multiple plans; a person must resolve ambiguity.

Training totals include all valid Run activities strictly before race day. The longest run on race day supplies race mileage. Rides and later runs are excluded. The overnight rule examines all runs, just as the Python excerpt does, independently of the training cutoff.

Verified fixture

Defaults come from the public synthetic activity and plan CSVs. The browser uses normalized miles and local date/time fields. The Python reader uses raw metric columns after duplicate display columns.

Human review

Same-date and unmatched labels explain the excerpt's date tests. They are a demonstration extension, not a one-to-one workout assignment or the private training pipeline. This form rejects invalid inputs; Python skips invalid activity rows.