apopt.comCBE 493R Data-Driven Athletics

Course / Tutorials / Week 7 / CS-9

Case study CS-9 · Week 7 · about 75 min · Extension

A season of load: fitness, fatigue, and a taper

Turn two and a half years of an athlete's multi-sport watch history into a heart-rate load for every day and a fortnightly performance measure, fit Banister's fitness–fatigue model on 2024–25 and test it on 2026, and find out how little it can say about when to taper.

  1. 1Gather (used)
  2. 2Statistics (used)
  3. 3Visualize (used)
  4. 4Cleanse (used)
  5. 5Features (used)
  6. 6Balance
  7. 7Scale
  8. 8Split (used)
  9. 9Deploy
  1. Ask (this week)
  2. Collect
  3. Check (this week)
  4. Interpret (this week)
  5. Coach (this week)
  6. Reassess

Every cell runs in this page; the first run downloads Python (about 30 s). Nothing you load leaves your browser. Helpful first: CS-7 Critical speed from a watch archive.

The decision

The athlete has a race in twelve weeks and wants to know when to start his taper, the short reduction in training before a race. The fitness–fatigue model of Section 2.8 answers that question for any set of constants. If his own history pins the constants down, the model can set his taper; if it does not, the taper has to come from evidence about other athletes.

Predict first

Two and a half years of training, 693 activities with heart rate on almost all of them. Do you expect the history to pin down how fast fatigue fades (the fatigue time constant) to within, say, a week?

The raw data

Data dictionary
FieldMeaningUnitRangeMissing
start_timestart timeISO 8601 UTC2024-06-28 to 2026-11-28none
utc_offset_hlocal clock minus UTCh−7 to +3 (travel)none
sportFIT sport—running, fitness_equipment, swimming, cycling, hiking, generic, walking, trainingnone
sub_sportFIT sub-sport—indoor_running, elliptical, lap_swimming, indoor_cycling, road, track, strength_trainingblank on most
total_timer_timetimer time, pauses excludeds1.8–28 676none
total_distancedistancem0–21 859blank or 0 on 91, mostly elliptical and indoor bike
avg_heart_rateaverage heart rate (optical, wrist)beats/min67–188blank on 6
max_heart_ratemaximum heart ratebeats/min81–209blank on 5
avg_running_cadencerunning cadence for ONE foot (× 2 for steps/min)strides/min0–96blank on all but runs
Effort Pacethe watch's hill-adjusted speed (developer field; formula not published)m/s0.28–5.41blank on all but 473 outdoor runs

What is wrong with it: start times are in UTC, so the local day needs the offset (travel moves it from −7 to +3 h). Running cadence counts one foot. Elliptical and indoor bike sessions have no distance. Six activities have no heart rate, and the wrist reads swims poorly. Eight outdoor "runs" are fragments under a kilometre, and 22 runs of 5 km or more have a step rate under 160 a minute, 19 of them from July to December 2024: runs with walking breaks. A wrist sensor can lock onto the arm swing; two steady runs report a heart rate within 2 beats/min of the step rate. There is no performance test anywhere in the history, so performance has to be derived.

Step by step

Step 1 · Gather

The case file holds the activity history of an adult male athlete in his mid-40s: one watch, every activity from June 2024 to November 2026, one row per activity. The rows are the FIT file's session fields, in the watch's own names and units: times in seconds, distance in metres, start times in UTC with a separate offset to the local clock. Section 2.8 describes Banister's fitness–fatigue model, which turns a training history into predicted performance. The question here: fitted to this athlete's own history, can it say when to start a taper?

PythonStep 1 · Open the export and put each activity on its local day

Type a prediction to enable Run.

Show the expected result without running
693 activities, 2024-06-28 to 2026-11-28; heart rate on 687
                     n  with_hr  median_hr
sport                                     
running            475      471      157.0
elliptical          73       73      129.0
swimming            67       65      123.0
indoor_running      21       21      153.0
indoor_cycling      14       14      134.5
generic             13       13      140.0
hiking              13       13      110.0
walking             10       10      101.0
road                 5        5      124.0
strength_training    1        1      120.0
track                1        1      157.0

Heart rate is present on all but 6 activities, in every sport. Swims read low: a median of 123 beats/min against 157 on outdoor runs, below everything but hikes and walks. Part of that is real, since swimming is easier on the heart at the same effort, and part is the sensor: a wrist sensor under water reads poorly.

Step 2 · Statistics

PythonStep 2 · Two periods, many sports

Show the expected result without running
             first       last  activities   hours  run_share
period                                                      
2024-25 2024-06-28 2025-12-31         421  313.11       0.71
2026    2026-01-02 2026-11-28         272  219.07       0.64
sport
running              351.0
elliptical            57.0
swimming              57.0
hiking                21.0
indoor_running        17.0
indoor_cycling        12.0
generic               10.0
walking                5.0
road                   3.0
strength_training      0.0
track                  0.0
longest gap between active days: 27 days

Eighteen months before 2026 and eleven months in it, with no long break: the longest gap is 27 days. There is no natural seam, so the split for Step 8 is a calendar one: fit on 2024–25, test on 2026. About seven of every ten activities are outdoor runs; the rest are elliptical, swims, indoor runs, rides, hikes and walks, and they hold about a third of the hours.

Step 3 · Visualize

PythonStep 3 · Every outdoor run, speed against step rate

Show the expected result without running
median step rate, runs of 5 km or more: 176/min
runs of 5 km or more under 160 steps/min, by half-year: {'2024 Jul-Dec': 19, '2026 Jan-Jun': 1, '2026 Jul-Dec': 2}
Average speed in metres per second against steps per minute for 475 outdoor runs, open circles for runs of 5 km or more and crosses for shorter ones. Most runs sit in a tight cloud near 176 steps per minute and about 3 m/s; a tail of slower runs below 160 steps per minute, most from July to December 2024, runs down to the lower left; a few short fragments lie near zero, and some short fast efforts reach 4 to 5 m/s.

Most runs sit in a tight cloud near 176 steps a minute. Below 160 (the dashed line) is a tail of slow runs, 19 of the 22 longer ones from July to December 2024: runs with walking breaks, which lower the average speed and step rate together. A few fragments of under a kilometre lie near zero. And one problem the plot cannot show: a wrist sensor can lock onto the arm swing and report the step rate as the heart rate.

Step 4 · Cleanse

Two products, two sets of rules, written down before any model is fitted.

Load keeps every activity, because every session tires the athlete. The six without heart rate get the median intensity of their own sport.

Performance runs must be steady outdoor runs whose heart rate can be trusted:

  1. Outdoor runs only (no treadmill, whose distance comes from the wrist).
  2. Runs of 5 to 12 km, long enough to settle, short enough to limit heart-rate drift.
  3. Heart rate and the watch's hill-adjusted speed both present.
  4. A step rate of 160 or more, so the run had no walking breaks.
  5. Heart rate not within 2 beats/min of the step rate (a possible lock on the arm swing).
PythonStep 4 · Apply the rules with a change log

Show the expected result without running
                              rule  removed  left
              1 not an outdoor run      218   475
                     2 not 5-12 km      119   356
    3 no heart rate or effort pace        1   355
             4 under 160 steps/min       21   334
5 heart rate within 2 of step rate        2   332

Step 5 · Features: a load for every day, and a performance measure

Load. The case file's rule: load = minutes × (average heart rate / HRmax)². The square makes a hard minute count more than an easy one, as the heart-rate load of Section 6.6 does. HRmax is a stand-in: the 99th percentile of the maximum heart rate over all runs, not a tested maximum. Every sport counts by the same rule, so an hour on the elliptical at the same heart rate counts as an hour of running. That is an assumption, not a fact: the legs take far less pounding on the elliptical or in the pool, and the wrist under-reads swims, so their load is likely too low. Loads are summed per day, with zeros on days off.

Performance. The history has no test, so one has to be derived. The measure: metres per heartbeat, the watch's hill-adjusted speed ("Effort Pace", whose formula is not published) divided by heart rate, the median over the performance runs in each 14-day block. Why: a fitter runner covers more ground per beat at an easy pace, and the median does not depend on whether he chose to run hard. Why it is a proxy: heat, sleep, illness and the sensor move the heart rate too, and a fortnight with one or two runs gives a noisy median.

PythonStep 5 · Daily load and fortnightly performance

Type a prediction to enable Run.

Show the expected result without running
HRmax stand-in 202 beats/min; 884 days, mean daily load 19.3; share of load not from outdoor runs 26%
       count   mean    std    min    25%    50%    75%    max
train                                                        
False   24.0  1.238  0.037  1.143  1.222  1.251  1.265  1.276
True    37.0  1.221  0.079  0.982  1.188  1.222  1.278  1.334

Sixty-one performance points, 37 in 2024–25 and 24 in 2026. In 2024–25 the measure climbs from under 1.1 metres per beat in the run-walk months of 2024 to about 1.3 by late 2025 (standard deviation 0.079). In 2026 it is nearly flat (0.037). About a quarter of the load (26%) comes from sessions other than outdoor runs. The model must explain the rise and the small wobbles around it.

Step 8 · Split: fit on 2024–25, test on 2026

The model of Section 2.8 is p(t) = p₀ + k₁·fitness(t) − k₂·fatigue(t), where fitness and fatigue are the daily loads before day t, each fading with its own time constant, τ₁ and τ₂. For fixed time constants the model is a straight line in p₀, k₁ and k₂, so the fit is a loop: for every pair (τ₁, τ₂) on a grid, fit the three numbers by least squares (with k₁, k₂ ≥ 0) on 2024–25, and keep the training error and the error on 2026.

PythonStep 8 · Fit every pair of time constants

Type a prediction to enable Run.

Show the expected result without running
2229 pairs; best fit: {'tau1': 90.0, 'tau2': 30.0, 'train_rmse': 0.0517, 'test_rmse': 0.05378, 'p0': 1.08041, 'k1': 0.00015, 'k2': 0.00014}
2024-25 mean as the forecast: train 0.078, test 0.040 m/beat
599 pairs fit within 5% of the best: tau1 57-90 d, tau2 1-30 d; test RMSE 0.052-0.055
dashboard pair (42, 7): [{'train_rmse': 0.057, 'test_rmse': 0.055}]

The best pair sits on the edge of the grid, τ₁ = 90 days and τ₂ = 30 days, with tiny gains. In training it beats the 2024–25 mean (0.052 against 0.078 metres per beat), because it can draw the slow climb of the build-up. On 2026 it does worse than that same mean (0.054 against 0.040): fitness keeps rising with the load in the model, while the measure stopped rising. And 599 of the 2229 pairs fit within 5% of the best: every τ₁ from 57 to 90 days, and every fatigue constant from 1 to 30 days. The data say only that fitness changes slowly; they say nothing about how fast fatigue fades. The pair the dashboard uses for its 42-day and 7-day averages (Section 6.6) fits worse (0.057) and forecasts about as badly (0.055).

PythonStep 8 · The error landscape, and the forecast

Show the expected result without runningTwo panels. Left, training error over a grid of fitness time constant (5 to 90 days) and fatigue time constant (1 to 30 days); the error falls steadily toward long fitness constants, and beyond about 60 days it barely changes with either constant; the best pair, a star, sits in the top right corner at 90 and 30 days. Right, metres per heartbeat from mid-2024 to late 2026 with the model fitted on 2024-25; it follows the climb from about 1.1 to 1.3 in 2024-25, then rises again in late 2026 while the points level off near 1.25 and dip toward 1.15 in the autumn.

Try the same model on a plan you draw yourself. The viewer below runs Banister's model in the page: change the taper's length and load, the two time constants and the weight on fatigue, and watch how the best race day moves. Try a fatigue constant of 2 days and then 20: the data here could not tell those apart.

Model · fitness, fatigue and a taper
Performance at the end of the block
753
Best day
day 59, 17 days after the taper starts
Best performance
997
0500100015000204060taper startsbestfitnessfatigue × k2performancedayarbitrary units
Move over the chart to read values.

With the book's values (6 weeks, τ1 = 42, τ2 = 7, k2 = 2), hard training first lowers performance and a taper lets fatigue fall while fitness stays. The constants differ between athletes and are hard to pin down from one athlete's data, which is why CS-9 asks how weak the evidence is. Illustrative units; not a prescription.

Step 5 · When to start a taper?

A taper is a short reduction in load before a race, which lets fatigue fade while fitness stays (Section 2.8). Ask each of the near-equally good models the same question: on a plan of twelve weeks at this athlete's 2026 mean daily load, with the last N days at half the load, which N gives the best race day?

PythonStep 5 · The best taper, model by model

Type a prediction to enable Run.

Show the expected result without running
base load 21.0 a day; 599 near-best models: best taper from 0 to 2 days (median 0), predicted gain up to 0.0004 m/beat
{0: 517, 1: 70, 2: 12}
dashboard pair (42, 7): best taper 3 days, gain 0.0013 m/beat

Almost every near-best model says the same thing: no taper at all (517 of 599), or one or two days, with a predicted gain of at most 0.0004 metres per beat, far too small to measure. The dashboard pair says 3 days, for 0.0013. That is not evidence that a taper does nothing. It says that this measure, the ground covered per beat on an easy run, follows the slow build of fitness and barely moves after a hard week, so the fit learns nothing about fatigue. A taper acts on fatigue. The performance measure decides what the model can learn.

PythonStep 5 · Same question, a different performance measure

Type a prediction to enable Run.

Show the expected result without running
best (tau1, tau2) = (90, 1); train 0.301, test 0.249 m/s; 2024-25 mean as forecast: train 0.315, test 0.224
1666 of 2229 pairs within 5%; best taper 0-22 days (median 2), predicted gain up to 0.064 m/s

With the fortnight's fastest run as the measure, the answer changes. This measure depends on whether the athlete chose to run hard, and it is noisy: the model again forecasts 2026 worse than the 2024–25 mean (0.249 against 0.224 m/s), and 1666 of the 2229 pairs fit within 5% of the best. Those models recommend tapers from 0 to 22 days (median 2), with gains up to 0.064 m/s. Two defensible proxies, two different answers, and neither forecasts better than a flat line. The history cannot set the taper.

Evidence from many athletes is stronger than a fit to one: a meta-analysis of 27 studies found the largest performance effect for a taper of about two weeks, with training volume cut by 41 to 60% and intensity and frequency kept (Bosquet and colleagues, 2007). The same weakness of the fitted model is reported in elite swimmers, where the fitted time constants had wide intervals and some parameters were so correlated that their separate values meant little (Hellard and colleagues, 2006). Treat the model as a way to think, as Section 2.8 says, set the taper from the population evidence, and watch this athlete's response. This is training information, not medical advice.

How good is the number?

Fit. With metres per heartbeat as the measure, the best model (τ₁ = 90 days, τ₂ = 30 days, both on the edge of the grid) has a training error of 0.052 metres per beat against 0.078 for the 2024–25 mean: it draws the slow build-up.

Held out. On 2026, fitted only on 2024–25, it errs by 0.054, worse than simply predicting the 2024–25 mean (0.040). It has no forecasting skill here. With the fortnight's fastest hill-adjusted run as the measure it also loses to the mean (0.249 against 0.224 m/s).

Determination. 599 of 2229 pairs fit within 5% of the best: τ₁ anywhere from 57 to 90 days and τ₂ anywhere from 1 to 30 days. The fatigue constant, the one a taper depends on, is not pinned at all. Elite swimmers show the same problem: wide intervals for the time constants and parameters too correlated to interpret separately (Hellard and colleagues, 2006).

Proxies. Both the load and the performance measure are stand-ins. Load treats an elliptical or swim minute like a running minute at the same heart rate, uses an HRmax that was never tested (202 beats/min, the 99th percentile of run maximums), and gets low wrist readings from swims. Metres per heartbeat moves with heat, sleep and the sensor as well as fitness, and barely responds to a hard week. The two performance measures give different taper answers (none, or 0 to 22 days), which is itself the finding.

Action card

Action card
Finding
Your own history cannot say when to start your taper; models that fit it equally well say anything from no taper to 22 days, depending on how performance is measured.
Evidence
61 fortnightly performances over 29 months; fitted on 2024–25, the model forecast 2026 worse than the 2024–25 mean; any fatigue time constant from 1 to 30 days fits almost as well.
How sure
Sure that the history cannot set the taper; the population evidence below is much stronger than this fit. Training information, not medical advice.
Action
Plan a taper of about two weeks with volume cut by 41 to 60% and intensity and frequency kept, the pattern a meta-analysis of 27 studies found best.
Test again
Run a 5 km time trial on the same flat route every two to three weeks of the build and after the race, so the next fit has real performance tests.

Track it

The history adds no new row by itself. What it lacked is a performance test, so add one: test=time-trial-5k, metric=speed_mps, value, unit=m/s, protocol_version=flat-route-v1, every two to three weeks, and keep each day's load (test=training-load, metric=load_au) from the same rule as this study: minutes × (average HR / 202)², every sport included.

Open your athlete record

With your own data

Export your own activity history (one row per activity with date, duration and average heart rate), apply the same load rule to every sport, and decide how cross-training should count. Then choose a performance measure you can defend. A regular time trial is far better than any measure derived from training runs.

Check the AI

Asked "what does my training history say about my fitness?", an assistant wrote:

> I fitted the Banister model to your fortnightly metres per heartbeat. The best fit has a > fitness time constant of 90 days and a fatigue time constant of 30 days. So your fatigue > takes a month to clear: taper for four weeks before your race.

What is wrong with it?

The 30-day fatigue constant is not determined: every value from 1 to 30 days fits within 5% of the best, and both best-fit constants sit on the edge of the grid. The best model also forecast 2026 worse than the 2024–25 mean, and the near-equal models recommend no taper at all. A four-week taper rule goes far beyond what the data show.

Check yourself

  1. Why is 2026, not a random half of the fortnights, the test set?

  2. With the time constants fixed, why can p₀, k₁ and k₂ be found by linear least squares?

  3. The best fit lands on the edge of the grid (τ₁ = 90, τ₂ = 30 days), and every τ₂ from 1 to 30 days fits almost as well. What does that tell you?

  4. Two performance measures, metres per heartbeat and the fortnight's fastest run, give different taper answers. Why?

  5. An elliptical session of 40 minutes at an average heart rate of 150 beats/min, with HRmax 202. What load does the rule give?

    load units

0 of 5 answered · 0 right the first time

Challenge: How many tests would pin it down?

The history could not determine the fatigue time constant. Find out what would. Section 2.8's model, run forward with constants you choose, can make a season with tests whose true answer you know, as book/ch11-statistics/code/fitness_fatigue.py does.

  1. Simulate this athlete's real daily load from Step 5 through the model with chosen constants (for example τ₁ = 42, τ₂ = 7 days) and add test noise of 0.1 m/s to a 5 km time-trial speed.
  2. Sample performance every 14 days, as in this study, and fit the grid of Step 8. Are τ₁ and τ₂ pinned?
  3. Repeat with a test every 7 and every 3 days, and with noise of 0.05 m/s. How many tests, and how precise, would pin τ₂ to within 5 days?
  4. Write a testing plan the athlete could follow in the next build.

Hand in

How it is judged

Hints

    The solution unlocks after you make an attempt. Comparing your own attempt with it is where the learning happens.

    The same method in another field

    Two first-order responses with different time constants, fitted to sparse noisy measurements, is a classic identification problem: the same trouble appears when fitting a two-time-constant model of a heater or a battery from a few readings. When the data do not excite both time constants, many parameter pairs fit equally well. See the Machine Learning for Engineers page on ARX time-series models.

    Acknowledgements

    Activity summaries of an adult male athlete in his mid-40s from a COROS Training Hub archive, published in the course case file (athletes/jh/coros-history/). Training information only, not medical advice.

    References

    Built 2026-12-02 with Python packages numpy 2.5.5, pandas 3.1.1, matplotlib 3.11.2, scipy 1.18.1. In the browser the same code runs on Pyodide, so the last digit can differ.