betting_combat.features.fighter
fighter — each fighter as of each of his fights (Sam 2026-11-11): one row per fighter per fight he
has had, dated that fight’s day (as_of), holding everything known once it was over. A fight
joins each fighter’s latest row dated BEFORE its day (rows.prefight); a debut has none.
Every official fight counts (UFC, the Contender Series, Road to UFC: their lines are official);
the UFC record (ufc_*) counts only UFC fights, the Contender Series apart (dwcs_*).
What a row holds (from the fights up to and including its own):
record UFC fights, wins / losses / draws / no contests, by KO / submission / decision both
ways, finish, finished and decision shares, first-round finishes, the mean finishing
round, title fights and wins, main events, five-round fights, rounds and minutes
fought, split decisions, rounds reached (shares of the fights scheduled that long),
the streak, the last three
lines every official line both ways (his, his opponents’ against him) shaped by
RATES: per minute, per 15 minutes, accuracy, defence, where and what he lands
(shares), differentials, pace, ground and pound, the wrestling index, the exchange
(log of landed over absorbed); three windows: career (c_), last three (l3_),
exponential (e_, half-life HALF_LIFE fights); every rate a ratio of sums, its
denominators kept (x_ exposures) for the shrinkage the join applies
judges the judges’ mean verdict on his rounds (+1 all his, -1 all the other’s), his mean
margin a judged round, 10-8 rounds won and lost
finishes how he finishes and is finished: punches / kicks / knees / elbows, standing or on
the ground, chokes or joint locks (shares of his KO / submission wins and losses)
rating an Elo over every official fight (ELO), his opponents’ mean Elo before he met
them, the beaten ones’, the best win’s
adjusted his lines less what each opponent allowed before him, and what he allowed less
what they landed before (ADJUSTED; minutes-weighted, the three windows)
styles his record against grapplers, strikers and power punchers, each opponent typed by
his own lines before the fight (grappler / power)
spread the swing of his per-fight strike differential (consistency)
dates his last fight, first UFC fight, last KO loss and last weight class (the join turns
them into layoffs, time in the UFC, moves)
Classes
FighterTable
Bases: FeatureTable
features.fighter: one row per fighter per fight he has had (as_of its day).
compute
compute(base: Base) -> pd.DataFrameFunctions
appearances
appearances(base: Base) -> pd.DataFrameOne row per fighter per completed fight (both corners), in each fighter’s order of fights: who, against whom, the result from his side, how and when it ended, his official lines (s_), his opponent’s (o_), the differences (d_), the pace (p_sig_a), the judges’ rounds.
derive
derive(S: pd.DataFrame, w: str) -> pd.DataFrameA window’s rates (RATES), the exchange, and its exposures (x_: each denominator’s sum).
finish_kind
finish_kind(detail: str | None, end: str | None) -> tuple[str | None, str | None](what, where) of a finish from UFCStats’s details: a KO’s punch / kick / knee / elbow / other, a submission’s joint / choke / other; standing / ground where the details say (a ‘Rear Naked Choke’ does not).
windows
windows(A: pd.DataFrame, cols: list[str], by: tuple[str, ...] = ('fighter_id',)) -> dict[str, pd.DataFrame]Each row’s sums of cols over its group’s rows to it (A in each group’s order):
career (c), the last three (l3), exponential (e: weights halving every HALF_LIFE rows,
scaled back to sums).