# M2: five-season champion relationships

[中文](README.md)

Open the project `index.html` and choose **M2 relationship workbench**. It reuses the GitHub UI, offers Chinese/English and light/dark themes, and preserves M1/M3 coefficients and forecasts.

## Data and scope

2022–2026 annual LCK/LPL/LEC/LCS/LCP top-division membership; PCS/VCS/LJL are accepted LCP predecessors for 2022–2024, and 2025 North America uses LTA North. Keep a formal game if at least one side is eligible, including its opponent, international events and completed DCGI. Confirmed blind picks are excluded. 2021 only seeds historical candidate identities.

The snapshot retains 13,657 games, 136,510 player-stat rows and23 DCGI supplement games. Four newest games have GoL internal checks and secondary lineup corroboration; complete independent BP verification remains pending. Six games lack complete player statistics. Two lineup/champion conflicts are retained in the archive but excluded from all relationship fitting and choice opportunities. 2022–2024 primarily use original Oracle's Elixir statistics; complete independent GoL verification is not claimed.

`research/m2_five_seasons/manifest.json` gives coverage, hashes, missing games and exclusions. Original OE fields (including team rows), all recovered GoL cells, normalized player statistics and source values remain separate. Damage types, DPM, shares, CC, healing, shielding and vision are retained wherever supplied. Missing data stay null. GOLD% is not confused with earned-gold share. Disputed 15-minute labels are masked individually; raw values remain available.

## Separate outputs

The lane interface now highlights one **−1…+1 matchup-advantage coefficient**; details are collapsed. Positive favors the first side; negative favors its opponent. It is not a win probability or a causal effect.

Professional lane data remove team/player, strength, patch and side backgrounds, then standardize residuals by historical metric variation. Initial gold/CS/XP weights are .45/.30/.25; 10/15/20/25-minute weights are .40/.50/.075/.025. Correlated observations from one game form one evidence row and sparse estimates shrink toward even. Ranked evidence uses matchup whole-game wins after champion-wide win baselines. The initial fusion policy is .8 professional/.2 ranked followed by tanh; missing evidence is explicitly handled. Bottom remains a full four-hero professional unit, never two summed duels. Weights are transparent engineering choices, not newly optimized counter-ground-truth weights or a claimed S15 accuracy gain. See `lane_coefficients.json`; reversing a matchup reverses the sign.

**Lane/development:** separate models for top, mid, jungle development and full bottom matchups at 10/15/20/25 minutes, for CS/gold/XP. Bottom always means **ADC + support vs ADC + support**, with combined gold/XP and ADC CS. Shared pair terms and an exact four-champion residual sit above champion baselines; this is not the sum of two independent duels. Role labels do not establish physical lanes or lane swaps.

**Cross-role performance:** regularized logistic outcome model with patch, season, event, rules, game number, strictly pre-match strength, team, player and role-specific single-champion controls. Same-team terms enter as blue minus red; enemy terms are directional. Four-dimensional low-rank sharing can estimate unseen pairs without creating fake observations. Twenty series-block refits provide percentile stability ranges, not causal-effect confidence intervals. Raw co-occurrence or win rates are not called counters.

**Conditional co-selection:** Classic and Full Fearless have separate availability denominators. The latter removes both sides' previously picked series champions; both remove current locked picks and bans already effective at that pick phase. Unknown rules, incomplete history or unverified order are excluded from opportunities, not automatically from performance data. Candidates are previously observed professional role champions, not a recovered full official legality list. Expectations use strictly prior-day, 45-day-decayed role/meta, team, patch, rules, side and pre-match-strength context. Smoothed excess log lift measures choice tendency, not combat synergy or live next-pick probability.

## Weighting and evaluation

```text
2^(-age/half-life) * exp(-0.01*normalized patch distance)
* event importance * exp(0.8*clip((mean pre-match Elo-1500)/400,-1,1))
* event games^(-0.25) * (1.4 for game one, otherwise 1)
```

Event importance: Worlds 2, MSI 1.8, EWC 1.4, First Stand 1.3, regional qualification 1.45, playoffs 1.35, DCGI/KeSPA .75, promotion .4, regular 1. Regional Elo priors reset annually; K=20 updates only from completed prior-day games. Structural relation half-lives 45/365/730 days are selected chronologically. This does not change M1's patch-response or recent-data weights. Both raw N and Kish ESS are displayed.

Whole series are separated: train before July 2025; select July–14 September; calibrate 15 September–13 October; retrospectively test 84 S15 Worlds games. Frozen choices are also tested on post-June 2026, then final models fit all completed snapshot games. These are retrospective tests, not fresh prospective blind trials. Later-timepoint labels are conditional on having those observations.

Reports retain every candidate, MAE/RMSE, log loss/Brier, interval coverage and a separately tuned main-effect baseline. Relationships do not improve every target; no broad accuracy gain is promised. Sparse-data simulations draw historical calibration errors by series, never extra training games.

## Ranked calibration

Historical KR Challenger-seeded data include 2,493 full lineups and 7,479 top/mid/full-duo early-game rows; participant tiers are not individually verified. Same-label early-game transfer weights 0/.05/.2 are selected against professional chronological validation.

Current OP.GG KR Master+ 26.20 supplies255 champion-role endpoints and2,925 directional whole-game records. It cannot supply CS/gold/XP or four-champion duo labels. Outcome residuals subtract ranked single-champion baselines; current transfer is displayed as sensitivity only. Reverse records may overlap and are never summed as independent games. Current snapshots do not enter historical tests. Historical outcome-calibration gains are tiny and do not establish population/patch equivalence.

## Reproduction

Python 3.11+, NumPy and SciPy. Restore existing frozen input bundles using the repository download/hash tooling; manifests list exact paths and hashes. From the repository root:

```bash
python -m models.relationships.m2_rebuild.collect
python -m models.relationships.m2_rebuild.recover
python -m models.relationships.m2_rebuild.prepare
python -m models.relationships.m2_rebuild.opportunities
python -m models.relationships.m2_rebuild.train
python -m models.relationships.m2_rebuild.bootstrap
python -m models.relationships.m2_rebuild.lane_coefficient
python -m models.relationships.m2_rebuild.report
python -m models.relationships.m2_rebuild.export
python tools/build_unified_results.py
python tools/check_m2_rebuild.py
node tools/test_m2_query.cjs
```

Public collection is cached, hashed and rate-limited; 401/403/429 stop collection. Unresolved recovery conflicts are retained rather than guessed. Large normalized datasets and fit caches belong in separate data bundles, with source/model JSON and reports in Git. Do not load untrusted pickle files.

References: [SIDO](https://arxiv.org/abs/2403.04873) for own/ally/enemy context, [professional paired comparisons](https://arxiv.org/abs/2609.08060) for pre-match strength and temporal validation, and [BPGG](https://bpgg.app/en/about) for presentation inspiration only.
# Pre-Worlds team lane draft priorities

Run `python -m models.relationships.m2_rebuild.team_lane_priority` and `python tools/check_team_lane_priority.py`. Independent outputs are `results/team_lane_priorities.html` / `.en.html`, root plain-text reports, and `artifacts/team_lane_priority/`. Existing M1/M3 forecasts and the current M2 coefficient table remain frozen.

The three-calendar-month windows start 2025-07-14 and 2026-07-15, excluding Worlds on 2025-10-14 / 2026-10-15. Only completed pre-event records are used. Aliases are merged; domestic regional qualifiers do not inherit Worlds importance from a source WLDs code. Existing scope is incomplete for domestic CBLOL; VKS/FURIA/LOS small international samples are provisional.

Professional early matchup coefficients use two-fold whole-series held-out 10/15 CS/gold/XP residuals (metric weights .30/.45/.25, time weights .4/.9 and .5/.9). Exact-pair estimates exclude the evaluated whole series, with regularized joint role/hero priors for sparse pairs. Bottom is the complete four-champion matchup. Ranked transfer uses only the dated March-April 2025 Challenger-seeded snapshot, not a claim of all-player Master+; its maximum .2 mass decays with a 365-day half-life. Current 26.20 matchup data never enter these retrospective windows.

Per-game attention is `.5*K + .25*max(K,0)*early_complete + .25*max(K,0)*late_response`. Bottom completion requires both members; same-turn consecutive picks reveal no new opposing choice. The index is `50 + 50*shrunk weighted mean of attention minus context baseline`, with ESS/(ESS+8) shrinkage and a 45-day team-window half-life. Side, league, format and series stage control the baseline; known Fearless, Classic and unknown rules remain distinct. First-game and later-game strata are exported.

This is a transparent descriptive policy, not an optimally trained intent model or a win probability. Four hundred series resamples provide adjacent-order stability; below 80% is shown as ≈. Resampling conditions on estimated coefficients and omits total model uncertainty. Final roles do not establish live flex knowledge. Other series in the same pre-Worlds window may contribute retrospectively, so this is not a rolling real-time backtest. Scores are centered separately by year.

