betting_combat.rounds.features.context
Card and fight context, one row per fight_id.
Port of the research ufc/dataset/context.py; the numbers must stay identical. The
research read Wikipedia’s event list from a file; here it is the text of the same JSON
(UfcTables.wiki_events_json).
segment seg_main / seg_prelim / seg_early_prelim (one-hot). From Wikipedia’s fight card where matched; otherwise from card position (first 5 bouts = main card, next 4 = prelims, rest = early prelims) with segment_from_wiki = 0. slot slot_main_event / slot_co_main / slot_main_card (other main-card bouts) / slot_undercard (one-hot), and slots_from_main (0 = main event, capped at 12). fight five_rounds, title, women, div_* (one-hot weight class), n_bouts on the card. event ev_numbered / ev_fight_night / ev_network (on ESPN/ABC/FOX/FX/Fuel/Versus/Spike) / ev_tuf (one-hot), apex (UFC Apex, the small cage), high_altitude (Mexico City, Denver, Salt Lake City, Bogota, Quito), in_usa, and the region one-hot (usa / brazil / europe / asia_mideast / other_region). Venue from Wikipedia’s event list, matched by date (and name where two events share a date).
Classes
CardContext
build
build() -> pd.DataFrameevent
event() -> pd.DataFramesegment
segment() -> pd.DataFramevenues
venues() -> pd.DataFrame(date, name, venue, place) per event from Wikipedia’s ‘List of UFC events’.