Data / tutorials
Tutorial data
One folder per course tutorial: raw/ holds the inputs as the device or app wrote them, clean/ the cleaned copies the tutorial writes, and expected/ what a correct run prints and saves.
Tutorial
Tutorial CS-1: How high did I jump?
Measure one countermovement jump three ways from a slow-motion phone clip (a frame count, the rise of the hips in pose keypoints, and the jump app's own formula), decide which to trust, and start the athlete record.
Tutorial
Tutorial CS-2: A step test and a first straight line
Turn a partner's step-test sheet into heart rate and lifting power, fit heart rate against workload, test the line on a stage it has not seen against a mean baseline, and read off a heart rate for easy sessions.
Tutorial
Tutorial CS-3: Predict the arc of a jump
Predict a jump's center-of-mass parabola from its takeoff velocity, lay it over the tracked hips frame by frame, and use the fitted curvature to check the scale and the true capture rate of a slow-motion clip.
Tutorial
Tutorial CS-4: A messy watch export to a clean table
Take 693 activity summaries in a watch's own field names and units, audit every unit with an identity, write the cleaning rules first, keep a change log, and produce a quarterly running summary a coach can trust.
Tutorial
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).
Tutorial
Tutorial CS-6: From a chest-strap recording to a recovery number
Check a chest strap's beat intervals against its own ECG, clean two nights of sleep with a written artifact rule, compute a nightly RMSSD with an honest interval, and find out what two nights can and cannot say about a baseline band.
Tutorial
Tutorial CS-7: Critical speed from a watch archive
Search 19 training runs for best efforts of 2 to 15 minutes, fit the speed–duration line, test it by holding out efforts and whole runs, and turn what it can and cannot say into a threshold pace.
Tutorial
Tutorial CS-8: Find a lactate threshold, and see if it moved
Apply four threshold rules to two SIMULATED step tests made with the production–clearance model, compare them with the true threshold the model knows, estimate each rule's typical error, and decide whether eight weeks of training moved the threshold.
Tutorial
Tutorial CS-9: 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.
Tutorial
Tutorial CS-10: Pose estimation, frame by frame
Run a pose model on every frame of a running clip, turn it into a table of 17 keypoints, check it three ways without a ground truth, and decide what the clip can and cannot measure.
Tutorial
Tutorial CS-11: From keypoints to a knee angle over a stride
Turn a keypoint table into a knee angle, gate it, beat the left–right swaps, line the cycles up and average them into one curve with an error band, and find out which part of the curve is a measurement.
Tutorial
Tutorial CS-12: The body-weight force of each foot plant
Estimate the peak force under each foot from contact and flight times alone, compare left with right, carry one frame of error through, and check the model against a force-measuring treadmill.
Tutorial
Tutorial CS-13: Predicting peak left-leg force
Reproduce the course regression of peak left-foot force from gait measures, then find out why its R² of 0.94 does not hold for a new runner, and what physics adds.
Tutorial
Tutorial CS-14: The arc of a shot or a throw
Track a ball frame by frame in two phone clips, find which one holds an arc, clean its clock, and measure a tennis toss's height, speed and angle with gravity and the ball's size as the only references.
Tutorial
Tutorial CS-15: Is the change real? One test, twelve weeks
Read twelve weeks of a simulated jump record with a typical error, a smallest worthwhile change, a band, a run rule and the decision rule of Chapter 11, through a learning effect, a bad Monday and a new phone; then repeat the method on two and a half years of an athlete's real runs, where pace and heart rate tell different stories.
Tutorial
Tutorial CS-16: Forecast next week, and beat "same as last week"
Turn two and a half years of watch activity summaries into weekly training load from heart rate, build forecasts from the past only, split by time, and test whether a regression really beats the persistence baseline; end with next week's load and a range.
Tutorial
Tutorial CS-17: From a notebook to a page an athlete can open
Move the foot-plant force formula out of a notebook into a JavaScript function that refuses bad input, prove the Python and JavaScript versions agree on normal, missing and invalid cases and on 44 real foot plants, compare a file analysed afterwards with a stream read step by step, and specify the phone page.
Tutorial
Tutorial CS-18: A one-page progress report
Turn twelve weeks of a simulated jump record into the one-page report of Chapter 13, with a progress chart against the athlete's own band and smallest worthwhile change, plain words, a stated range and likelihood, and a PNG and PDF made by code so no number can be copied wrong.
Tutorial
Tutorial Q-1: Run your first cell and change one number
Compute jump height from flight time in a browser cell, change the frame count and watch the height move twice as fast, then check the jump app's own result file with the same formula.
Tutorial
Tutorial Q-2: Step through a video one frame at a time
Read a slow-motion clip frame by frame, turn frame numbers into real time with the right clock, and find the repeated frames hidden in the file, all from a table with no pictures in it.
Tutorial
Tutorial Q-3: Pace from distance and time, checked three ways
Write a pace function, check it against three known cases with assert, then apply it to the instructor's 19 runs with moving and elapsed time and work out what the file's own pace column means.
Tutorial
Tutorial Q-4: Type a small table and plot it
Type a step test's paper sheet into a pandas table, add heart rate and lifting power, check every value against the file with assert, and draw one chart of heart rate through the test.
Tutorial
Tutorial Q-5: Fit a straight line and read the slope's units
Fit heart rate against step-test workload with least squares, state the slope in beats a minute per watt and per step cycle, and see why the line's intercept is not the resting heart rate.
Tutorial
Tutorial Q-6: A first-order response: heart rate after a step
Cut the first stage out of a chest strap's step-test record, fit a first-order response with curve_fit, and read the time constant three ways.
Tutorial
Tutorial Q-7: The angle from three points
Write the angle-from-three-points function, check it on the book's worked example, and apply it to every frame of a pose table to draw a runner's knee flexion stride by stride.
Tutorial
Tutorial Q-8: Speed from positions, and what noise does to it
Compute speed and acceleration from a flight's noisy positions by central differences, compare them with the known truth, and see why a faster camera makes derivatives noisier.
Tutorial
Tutorial Q-9: Fit a parabola to a flight and recover gravity
Fit a parabola to the hip track of a real slow-motion jump, recover gravity on the camera's clock, and see it come out sixteen times too small on the file's clock.
Tutorial
Tutorial Q-10: Open a phone sensor log and plot it
Open a phone accelerometer log, compute its real sample rate from the time stamps, turn three axes into one magnitude, and plot the whole session and a zoom to see the steps and the faults.
Tutorial
Tutorial Q-11: Write a data dictionary for one file
Write a data dictionary for one of the instructor's per-second watch files, with units, allowed ranges and missing-value codes, before looking at the values, then count which rows break which rule.
Tutorial
Tutorial Q-12: Find and mark the missing values without deleting anything
Find empty cells, zero codes and gaps in time in one of the instructor's watch files, mark each with a reason in a copy that keeps every row, and see where the missing values cluster.
Tutorial
Tutorial Q-13: Find the beats in ten seconds of ECG
Read the clock of a raw chest-strap ECG file, find every R peak in ten seconds with a band-pass, slope and threshold, and check the count against the strap.
Tutorial
Tutorial Q-14: Heart rate from beat intervals
Turn a strap's beat-to-beat intervals into heart rate, find out why the mean of the beat rates is the wrong session average, and compare with the strap's own smoothed display.
Tutorial
Tutorial Q-15: One night's RMSSD
Apply an artifact rule to a night of chest-strap beat intervals, compute RMSSD in five-minute windows, and report the night as the median of its valid windows.
Tutorial
Tutorial Q-16: Open an activity file and list its fields
Decode a running watch's binary FIT file into plain tables, list every message and field with its units, and find the pauses before any analysis.
Tutorial
Tutorial Q-17: Split a run into laps
Assign every one-second watch record to a lap from the lap start times, rebuild the watch's lap table with pauses removed, and pick out the fast repeats.
Tutorial
Tutorial Q-18: Count steps from an accelerometer
Band-pass a chest accelerometer, count footstrikes with a minimum gap between peaks, turn them into a cadence, and check it against the spectrum and the known answer of a synthetic record.
Tutorial
Tutorial Q-19: Interpolate a threshold from four points
Find where a step test's lactate curve crosses a level by straight-line interpolation, apply a fixed and an individual threshold rule, and check the arithmetic against a smooth fit.
Tutorial
Tutorial Q-20: Find the lag between two signals
Find how many minutes a glucose sensor trails its reference by cross-correlation, then measure its error after aligning the clocks, on a synthetic record with a known answer.
Tutorial
Tutorial Q-21: Sweat rate from two weighings
Turn a log of weighings before and after runs into sweat rates and body-mass losses, catch a value typed in the wrong unit, and relate sweat rate to air temperature.
Tutorial
Tutorial Q-22: Detect a person in one image
Run an object detector on one street photo, keep its boxes as a table, and draw them without the photo to see who it found and who it missed.
Tutorial
Tutorial Q-23: Read a video frame by frame and save every tenth frame
Read a running clip's header, loop over its frames, save every tenth picture on your own computer, and publish a table with one row per frame.
Tutorial
Tutorial Q-24: Seventeen keypoints for one frame, as a table
Open a pose model's keypoint table, turn one frame's row into 17 rows of x, y and confidence, and draw it as a stick figure.
Tutorial
Tutorial Q-25: Find foot contacts in an ankle trace
Find each foot contact in a treadmill runner's ankle trace, first the naive way, then with the running app's three guards.
Tutorial
Tutorial Q-26: Cadence from a cycle length
Get a runner's cadence three ways from one ankle trace, and see why a median step at 30 frames per second can only give 164 or 180.
Tutorial
Tutorial Q-27: An asymmetry index, three definitions
Compute a left–right asymmetry three ways, as the walking app does for three measures, and see that the frame grid can matter more than the formula.
Tutorial
Tutorial Q-28: Height from flight time, with one frame of error
Turn a hand count of airborne frames into a jump height, see what the wrong frame rate does, and carry one frame of error through at four frame rates.
Tutorial
Tutorial Q-29: Median and spread of ten trials
Read ten results files into one table and describe each metric with a median and a robust spread, and see what one low shot does to the mean.
Tutorial
Tutorial Q-30: Track a ball and fit its path
Detect a tossed tennis ball in every frame, fit a line to its horizontal path and a parabola to its height, and use gravity to check the clip's clock.
Tutorial
Tutorial Q-31: Scale two features, the right way and the wrong way
Predict running pace from step rate and step length with a nearest-neighbor model, and see what scaling does, and what fitting the scaler on the test runs too does, with only 30 runs.
Tutorial
Tutorial Q-32: Split by athlete, not by row
Score one nearest-neighbor model of peak foot force twice, with shuffled steps and with whole runners held out by fixed folds, and see where the difference comes from.
Tutorial
Tutorial Q-33: A rolling mean and a band
Set a baseline band from four weeks of simulated morning heart rate, add a seven-day rolling mean that looks back only, and see which of the two shows a real rise first.
Tutorial
Tutorial Q-34: A calculation in a web page
Write the foot-plant force formula in Python and in JavaScript, run both on three hand-checked cases, and confirm they give the same numbers.
Tutorial
Tutorial Q-35: Three tests: normal, missing, invalid
Write the three input tests every app must pass, with assert, for a Python copy of the book's resting-heart app, then feed it a real-sized file in the right and the wrong units.
Tutorial
Tutorial Q-36: Read a results file in the browser
Open the jump app's JSON receipts field by field, check each against a filming log, join the jump height from the text results, and leave out the clip analyzed at the wrong frame rate.
Tutorial
Tutorial Q-37: One chart that makes one point
Draw a runner's step rate twice, as a plotting tool does by default and to the one-message template of Chapter 13, and see which of the five chart rules make the difference.
Tutorial
Tutorial Q-38: Say how sure you are in one sentence
Turn a change in a runner's step rate into one sentence with a range in steps a minute and a likelihood word from a named scale, and test that the same function also says when a change is not real.
Tutorial
Tutorial Q-39: Turn a table into an action card
Rank five shooting measures by how well they separate one player's made and missed shots, with a bootstrap range, and fill the five lines of an action card by rules so the words never claim more than the numbers.
Tutorial
Tutorial Q-40: Export a run from the running simulator and read it
Run a two-stage treadmill test in the running simulator, export the CSV, and read the heart-rate time constant, the lactate trend and a critical-speed forecast from it, each checked against values the model knows.
Tutorial
Tutorial Q-41: Drag and rolling resistance from a cycling-simulator export
Ride an exertion-step scenario in the cycling simulator, export the CSV, and fit the rider's drag area and rolling resistance from power and speed by least squares, then check them against the values the simulator used.