gcclean_test / data_dictionary.md
mpuchowicz's picture
Add files using upload-large-folder tool
e945c2f verified
|
Raw History Blame Contribute Delete
13.3 kB

GCclean dataset — data dictionary

One folder per table, in GoldenCheetah OpenData's layout. timeseries/ is Hive-partitioned by athlete_id (also kept as a column): each timeseries/athlete_id=<uuid>/part.parquet holds one row per 1 Hz second of each ride's HMM active window (first to last live pedalling, time_s rebased to 0 at the window's first second). The joinable companion tables are athletes/athletes.parquet, athlete_years/athlete_years.parquet, activities/activities.parquet and manifest/manifest.parquet.

Wall-clock time of a row: start_time_utc + active_start_offset_s + time_s (seconds), from activities. A recording longer than 24 h is reduced to its 24 h window with the most work before the active window is found (duration_capped in activities). The active window keeps the stops between live runs: is_live marks the pedalled seconds, and Cut 1 counted a ride's duration including stops (GoldenCheetah's recorded duration at screening, the window's span at the final recount) and counted a ride as powered when its data_flags carry P; filter on is_live for pedalled time. Channels recorded faster than 1 Hz are averaged within each second; "raw" below means uncleaned, not unaveraged.

timeseries (per-second)

column type meaning
athlete_id, activity_id String activity key; activity_id is GoldenCheetah's file name for the ride (its local start time, without .csv)
year Int64 the ride's year (joins athlete_years)
time_s Float32 seconds from the active-window start; whole seconds at 1 Hz, stored as Float32 to match GoldenCheetah OpenData
power_w Float32 power, watts (recording gaps zero-filled — see is_gap)
power_wkg Float32 power_w / the AY's median body mass (median_body_mass_kg in athlete_years); always finite: the build stops with an error if a shipped AY has no usable body mass, and never fills one in
distance_m Float32 cumulative distance, metres (GoldenCheetah's km x 1000, 6 significant digits); null where not recorded, raw where present
hr_bpm Float32 heart rate; null where not recorded, raw where present
cadence_rpm Float32 cadence; null where not recorded, raw where present
altitude_m Float32 altitude (may be negative); null where not recorded, raw where present
is_gap UInt8 (0/1) 1 = this second was a recording gap (power zero-filled)
is_live UInt8 (0/1) 1 = HMM-classified live pedalling. A model label, not a sensor fact.

MISSING DATA IS null — handle it explicitly. Companion channels are polars null wherever the device recorded no value (a recording gap or an absent sensor), and the raw reading everywhere else — this dataset performs no cleaning. A null is honest absence, not a 0 and not a NaN. Do not assume 0; an aggregation such as mean() silently skips null, so filter or impute deliberately (df.drop_nulls(<col>) selects exactly the real readings). Present values are unjudged: hr_bpm may be 0, altitude_m may be negative, distances may be large. Validity screening (implausible values, absent-sensor 0s, birth-year/age sanity) is left to the user, by design.

athletes — one row per athlete

athlete_id, gender (GCOD's raw value, as in GoldenCheetah OpenData), yob, sex (GCclean's normalized male/female/unknown from gender). yob (raw year of birth as GCOD recorded it — null only if GCOD had none; not range-checked, so implausible values like 0 or a future year DO appear and the consumer must screen them). Age = racing convention: ride year − yob. GCOD provides year-of-birth only. GoldenCheetah never fills the birth date of a new profile, which then defaults to 1 January 2000. This build ships 122 athletes with yob 2000 against 13 with 1999 and 7 with 2001, so 2000 is over-represented, consistent with unset profiles. A real 2000 birth cannot be told apart from an unset profile.

athlete_years — one row per (athlete, year)

athlete_id, year, n_rides_removed_cut4 and n_rides_removed_cut5 (how many of the athlete-year's rides Cut 4, the ceiling, and Cut 5, high volatility, removed: each removes the ride setting a failing season best, repeatedly, until the athlete-year passes, with no cap; filter on them to leave out heavily cleaned years), median_body_mass_kg (the per-AY median self-report, fixed once at Cut 0 and used as the power_wkg divisor — an aggregate, not a measured weight). The self-report is the weight in the athlete's GoldenCheetah profile, copied onto each ride, and GoldenCheetah pre-fills a new profile with 75 kg. This build ships 188 athlete-years at exactly 75.0 kg against 76 at 74.0 and 79 at 76.0, so 75.0 kg is over-represented, consistent with the default value. 65 shipped athletes record 75.0 kg on every ride of their history whose GoldenCheetah summary carries a power-duration profile (rides with no recorded weight are ignored, not counted against them). A default weight cannot be told apart from a real 75 kg rider who never edits the profile.

activities — one row per ride

athlete_id, activity_id, start_time_utc (the ride JSON's UTC start, timestamp[us, UTC]), utc_offset_minutes (int16: activity_id, the local start time, minus start_time_utc), sport, data_flags, has_timeseries (true for every shipped activity), year (the UTC year of start_time_utc; a ride started near New Year can fall in the adjacent year of its local activity_id), active_start_offset_s (int64: seconds from the recording's start to the shipped window's first second), duration_capped (the recording exceeded 24 h and only its max-work 24 h window was used), json_mmp_confirm_status (the ride's 1 Hz MMP against GoldenCheetah's own MMP for it: passed, diverged or unverifiable; shipped as a flag, no ride is removed on it), date (the ride JSON's date string as GCOD stores it), data_key_present, and the mean-power floor columns active_mean_wkg, active_measured_s, floor_mmp_protected, live_mean_frac_mmp1200, historical_pct_gate_cut (described below). date/start_time_utc/sport are null wherever the ride source lacked them (honest absence, like the companion channels — do not assume present). A blank string "" is different from null: it is the empty value GoldenCheetah itself stored (an athlete who never set a sport label). It is shipped as "", not converted. data_flags is never null: it is the 15-position string, or "". Two different things ship as "", and data_key_present (true / false, never null) tells them apart: true means the ride's source record carries a channel string, so a "" is GoldenCheetah's own stored blank; false means the record has no data key (or a JSON null there) and the build ships "" for it. The columns themselves are always present (the build stops with an error if the source omits them entirely). This build ships 55,679 rides with sport == "" (55,680 with a blank or whitespace-only label). Of the rides with data_flags == "", 0 have no channel string in the source (data_key_present false) and 382 carry GoldenCheetah's stored blank.

sport is the activity label as GoldenCheetah recorded it (set by the athlete or their device; not normalized). The build removed every ride whose label, trimmed and lower-cased, is on a declared list of 105 non-cycling labels (running, swimming, walking and hiking, skiing and skating, rowing and ski ergometers, gym and other sports, multisport, unspecified ergometers). Every label carried by 50 or more rides in the raw GoldenCheetah corpus was reviewed by its text; rarer labels were kept without review, and some of them name another sport (for example "schwimmen"). In this build 3,394 shipped rides (0.43%) carry such an unreviewed label. The rule reads the label only, so running or another activity recorded under a cycling, blank or unreviewed label is NOT detected and may remain (see R below). Duplicate detection also compared shipped rides with the removed non-cycling rides: 31 shipped rides have a power curve identical to a removed ride that carried a non-cycling label (by that label: row 15, run 10, swim 2, transition 2, ergo 1, gym 1, strength 1). They are kept as cycling; the comparison covers only curves of enough points that are not constant.

A ride with no JSON MMP (GoldenCheetah's ride summary carries no power-duration profile) does not mean the ride had no power: the per-second file can still carry power, and every shipped ride's per-second power is what ships here. This build ships 7,049 such rides.

data_flags is GoldenCheetah's raw channel-presence string for the ride, shipped byte-for-byte and not interpreted by the build. Each of its 15 positions shows the channel's letter when GoldenCheetah recorded that channel for the ride and - when it did not: T time, D distance, S speed, P power, H heart rate, C cadence, N torque, A altitude, G GPS latitude/longitude, L slope, W headwind, E temperature, V left/right balance, O muscle oxygen (SmO2/tHb), R running dynamics (ground contact, vertical oscillation, run cadence). The per-second files ship only time, distance, power, heart rate, cadence and altitude; GPS coordinates are not shipped. Use the flags to make your own cuts, e.g. indoor vs outdoor: a ride without G has no GPS track (often a trainer), but virtual-ride software can supply GPS and altitude, so G/A alone do not prove a ride was outdoors. An R flag can indicate running recorded under another label. This build ships 421 rides with R (0.05% of 780,523): 408 under reviewed-keep labels, 9 blank, 4 unreviewed. The build does not remove them. R is an incomplete detector: among the removed rides labelled run whose summary carries a power-duration profile (the kind that could hide among shipped rides), 73.0% carry it (36.0% of all removed run rides, most of which carry no power). These counts are therefore a lower bound on running under other labels, not its size. The flags describe GoldenCheetah's source file for the ride, not the shipped series: the per-second data is trimmed to the active window, so a channel flagged present may be absent from the shipped rows, and vice versa.

Mean-power floor columns

The build removed a ride only if its average power over the active window was below 0.5 W/kg of the athlete-year's body mass (recording-gap seconds left out, seconds of coasting or stopping inside the window counted) AND its maximal mean power over that same window was not within 10% of the athlete-year's best at any of the 28 durations from 1 s to 7200 s. The athlete-year's best at a duration is the highest active-window maximal mean power (recording-gap seconds as 0 W) among the athlete-year's rides the activity model kept, before the floor removed any; efforts outside a ride's active window play no part. A ride that sets or nearly sets that best, including a ride that is the only one of its athlete-year long enough to reach a duration, is therefore kept however low its average. active_mean_wkg is that average and floor_mmp_protected is true when the ride came within 10% of that best at some duration; neither is ever null, and every shipped ride either averages at least 0.5 W/kg or is protected. active_measured_s is the number of seconds with recorded power behind active_mean_wkg (the window's length minus its recording-gap seconds); it is disclosed so a user can judge how well each average is supported, and the floor applies no minimum to it. This build ships 129 rides below 0.5 W/kg that are kept only by that protection; a ride kept this way can still be mostly idle around one hard effort. live_mean_frac_mmp1200 and historical_pct_gate_cut give a stricter, optional quality filter the build does not apply: remove a ride whose average over the seconds the model labelled as live pedalling is below 18% of the athlete-year's 20-minute maximal mean power. That average covers the model's live runs lying fully inside the active window (recording gaps inside a run counted as 0 W), or the whole active window when no live run lies fully inside it. live_mean_frac_mmp1200 is that average divided by the 20-minute value; it is null when the athlete-year has no 20-minute value of at least 50 W (0 shipped rides). historical_pct_gate_cut is true when that fraction is below 18%, null exactly where the fraction is null; the filter keeps every ride with a null fraction, so a null here means "kept by the filter". This build ships 2,461 rides the filter would remove (historical_pct_gate_cut true). Near-flat traces averaging above 0.5 W/kg are not removed by the floor.

manifest — one row per athlete

n_rides, n_samples, total_duration_s and size_bytes of that athlete's partition. part_sha256 is the SHA-256 of that athlete's part.parquet exactly as written; recompute it to confirm a partition is the shipped one. gcod_zip_sha256 is the SHA-256 of the GoldenCheetah OpenData zip the partition was built from, so a partition can be traced to its raw file.