Skip to main content
Median of value_col over observations STRICTLY BEFORE the current row. The canonical point-in-time baseline. Two models compute one (int_lap_thermal_proxy’s stint baseline, 08e; int_corner_skill_residuals’ corner field median, 02g). A third point-in-time rebuild, int_sc_hazard_history (02d), needs a trailing RATE rather than a median and so calls trailing_sum() below over the same frame. Both leaks that opened 08 were a baseline built with a GROUP BY over a block that included the row it scored — write the window once, here, so the next one is a call rather than a rediscovery. Returns NULL where fewer than min_observations valid observations precede the row, rather than a median over one or two laps that is mostly noise. Those NULLs are NOT declarable from the feature contract: they are deterministic on the count of valid prior observations, which is not a contract axis. Emit trailing_observation_count() alongside as a companion column so a consumer can condition on it.

Signature

Arguments

Returns

scalar expression composable in a SELECT list.

Usage