betting_combat.features.stage2
stage2 — the second stage’s rows (2026-11-14): one per fight per break from the break after round 1
(model 1 has forecast at least one round of the fight), both fighters, built only from model 1’s
forecasts so far (features.forecasts), what the rounds fought showed (features.final’s prev /
so-far columns) and each fighter’s typical forecast misses over his earlier fights
(forecasts.typical_sums). The answer is the same five outcomes of the coming round
(features.labels.y5); the second-stage model starts from model 1’s chances for this break.
Why: within a fight model 1’s misses carry over from round to round (2015-26: r = +0.05, clearly above chance); nothing carries over between fights of a card, neighbouring fights or cards.
Columns - fc_ this fight, fct_ the fighters’ typicals; _a_ / _b_ one fighter’s side,
_d_ A minus B (changes sign when A and B swap), no side = the same either way:
1 forecasts the last break’s, the pre-fight’s and this break’s chances; sum / mean / max so far;
the chance model 1 gave of getting here; how sure it is (entropy, top outcome)
2 survived the finish chance the fight has survived (cumulative hazard: any, KO, submission, by
finisher), the last round’s, and the per-fight finish-rate estimate it implies
(gamma prior of k rounds, no finish seen: k / (k + hazard survived))
3 vs the round knockdowns against the KO chance forecast and submission attempts against the
submission chance (near finishes), last round and so far; who is winning by the
lines against the side model 1 leans to and against the books
4 A against B spreads and log ratios of the forecasts; model 1’s lean x the rounds’ lean
5 revisions this break’s chances against the last break’s, against what the last break implied
for the fight from here (distance, KO later, A wins), and beyond the clock’s own move
6 vs the clock model 1’s correction over its start (finish, KO share, side): now, last, mean so far
7 vs the books model 1 against the books’ line for the same round (finish, KO share, side)
8 typicals each fighter’s typical miss (he finishes / is finished, by KO / submission): every
round, this round number, against each style, against this opponent’s style; the
matchup (A’s typical miss finishing + B’s typical miss being finished); this fight’s
forecast against his typical forecast
Classes
Stage2Table
Bases: FeatureTable
features.stage2: the second stage’s rows (the module doc).
compute
compute(base: Base) -> pd.DataFrameFunctions
assemble
assemble(forecasts: pd.DataFrame, final: pd.DataFrame, labels: pd.DataFrame, targets: pd.DataFrame | None = None) -> pd.DataFrameThe second stage’s rows: within + typicals for every break >= 1 that forecasts
prices (final: features.final with FINAL_COLUMNS; labels: bout_id, brk, y5 - the
typicals read the outcomes of EARLIER fights only).
styles_of
styles_of(final: pd.DataFrame) -> pd.DataFrameEach fighter’s style weights the day of each fight (features.final’s profile columns, as of
the fight): bout_id, fighter_id, STYLES.
typicals
typicals(rows: pd.DataFrame, T: pd.DataFrame, now: pd.DataFrame) -> pd.DataFrameGroup 8 for rows (bout_id, brk, fighter_a_id, fighter_b_id, upcoming_round and both
fighters’ style weights prof_{a,b}_style_*) from forecasts.typical_sums (T) and this
break’s chances (now: row-aligned p_*).
within
within(W: pd.DataFrame) -> pd.DataFrameGroups 1-7 from one frame of forecasts + FINAL_COLUMNS (every break of each fight from
break 0): the rows of the breaks >= 1 whose earlier breaks are all there.