Machine Learning for Poker Opponent Modeling
Combining solver policies, player history, and empirical opponent models.
Stored solver policy
CFR+ / DCFR lookup
Legal action & sizing
Bounded conditioning and guards
Advice for the playerHistorical features
Completed hands and prior actions
Nine predictive layers
Probabilities and support checks
Context alongside adviceLater runtime: predictive diagnostics have zero strategy weight. The human makes the decision.
Overview
I built a poker decision-support system and research pipeline to study how stored solver policies and models of opponent behavior can inform human decisions. The system reconstructed visible table state, constrained advice to legal actions, and displayed predictions with their supporting context.
Across a 313,672-decision replay, the selected postflop model reached 67.37% observed-action accuracy on supported confirmation rows. That establishes predictive performance, not improved winnings. The public release contains the paper, methodology, notebooks, and aggregate results; trained weights and the live Assistant remain private.
Decision support under hidden information
Context
Poker provided a concrete setting for studying decisions with incomplete information. The same visible action can come from different holdings, strategies, or levels of experience. Position, stack depth, previous bets, and the number of remaining players all change its meaning.
I developed the project around three questions: which learned components improve on simple predictive priors, whether player and session history add useful information, and what recorded play can actually establish about outcomes. Those questions shaped both the interface and the evaluation.
Legal actions and reliable decision inputs
The Problem
Predicting an opponent’s next action does not identify the best action for the player. A recommendation also needs a valid game state, a legal action, an appropriate amount, and evidence that its inputs apply to the current situation.
The system therefore needed explicit boundaries between strategy references, empirical predictions, and uncertain historical evidence. Missing histories had to remain missing; revealed cards could supply training labels without becoming information available at an earlier decision. I treated abstention and source labels as part of the product.
Example: translating table controls into legal actions
Pot: 60 BB · Call: 20 BB · Stack: 100 BB
Fold · Call · Raise
Unavailable actions are excluded. Aggressive sizing must fit the observed bounds; inconsistent bounds cause abstention.
Illustrative state, not a recorded hand or a model recommendation.
System architecture
System
The read-only runtime reconstructed cards, stacks, betting controls, and the preceding action sequence. A legal-action mask removed unavailable choices. Stored policies and reviewed preflop references supplied the strategy foundation, followed by bounded conditioning and conditional sizing within the visible legal interval.
A separate path combined player histories with learned models and support checks. Earlier Testing versions blended supported predictions into experimental advice. The later runtime retained those predictions as diagnostics with zero strategy weight. The human player remained responsible for every betting decision.
Stored solver policy
CFR+ / DCFR lookup
Legal action & sizing
Bounded conditioning and guards
Advice for the playerHistorical features
Completed hands and prior actions
Nine predictive layers
Probabilities and support checks
Context alongside adviceLater runtime: predictive diagnostics have zero strategy weight. The human makes the decision.
Decision-time features and evaluation splits
Data & evaluation
The training source contained 2,334,700 decisions. Rule checks quarantined 1,239 inconsistent records, leaving 2,333,461 decisions from 202,788 hands across 447 games. Historical features used previously completed hands; within-hand features used only preceding actions. Identity resolution was retrospective.
Chronological selection separated fitting, development, and calibration. Frozen-model replay then covered 313,672 decisions in 60 games, with 106,318 confirmation rows before component-specific support filters. Comparisons used 23 whole-game clusters and paired bootstrap intervals, preserving dependence between decisions from the same game.
Decision-time features, chronological evaluation
- 01Train
1,821,293 earlier decision rows.
- 02Develop
398,940 subsequent decision rows.
- 03Calibrate
113,228 later decision rows.
- 04Replay
313,672 replay decisions.
Replay includes 106,318 confirmation rows, 198,448 development rows, and 8,906 training-overlap rows. Component support is evaluated separately.
Opponent-model architecture
Opponent models
I evaluated supervised tree ensembles from LightGBM, XGBoost, CatBoost, and Extra Trees. The selected layers model postflop behavior, within-hand sequences, joint action and sizing patterns, player archetypes, multiway responses, strategy drift, fold responses, bluff proxies, and showdown calibration.
Each layer has its own features and support requirements. The postflop predictor uses 61 public-state features; within-hand modeling extends that representation with the visible action sequence. Reveal-based layers carry selection limitations: observed holdings and bluff proxies do not expose every opponent’s cards or intentions.
Parallel opponent-model architecture
Board · position · stacks · pot · prior actions · completed hands
Public state, action sequence, and legal choices
Player histories, session histories, and observed opportunities
Supported fold responses and reveal-based training targets
Action probabilities, sizing information, historical support, and coverage
Display supported predictions and historical context; zero strategy weight
Independent strategy input
Stored CFR+ / DCFR policies, legal-action checks, and bounded sizing supply the advice
The interface presents advice and diagnostic context; the player chooses the action.
These are separate tree-ensemble predictors, not sequential neural layers. Revealed cards supply selected training targets; future cards are not decision-time inputs.
Offline policy training and runtime lookup
Strategy reference
The solver work used CFR+ and discounted CFR to train policies for declared poker subgames. Roots specified public histories, board textures, positions, stack depths, and range assumptions. The runtime consulted compiled policies instead of solving the full game during each hand.
The installed river-policy subset contains 67 roots, each with two CFR+ and two DCFR lanes. Evaluation covered both seats, behavioral opponents, and paired cross-play. These checks support the retained artifacts within their restricted contracts; they do not establish equilibrium play for every live state.
Offline solving → runtime lookup
- 01Restricted roots
Specify public state, stack anchors, and range families.
- 02CFR+ / DCFR
Update regret and accumulate strategies offline.
- 03Stored policy
Retain evaluated policies for supported situations.
- 04Runtime
Select, condition, and constrain to legal actions.
Restricted policy references, not a new full-game equilibrium solve at every decision.
Predictive performance against baseline models
Predictive results
All nine selected layers improved log loss over their frozen priors on supported confirmation rows. The postflop model achieved 67.37% accuracy on 42,451 rows, reducing log loss from 0.7955 to 0.6507. Its paired improvement was 0.1448, with a stored interval of 0.1352–0.1555.
The comparison changes when the selected postflop model becomes the baseline. No alternative reliably improves on it. The within-hand model’s interval crosses zero; the other alternatives trail it. This finding argues for evaluating each contribution before combining models into a recommendation.
View full size Predictive support
How much of the confirmation cohort each model covers
Every component is evaluated across 23 games, with its own support filters. The bars show coverage of the 106,318-row confirmation cohort. These overlapping subsets are not additive, and their accuracy values do not form a like-for-like model ranking.
View component metrics
| Component | Rows | Coverage | Accuracy | Log loss | Prior log loss |
|---|---|---|---|---|---|
| Joint action and size | 105,924 | 99.6% | 62.81% | 0.8695 | 0.8979 |
| Player archetype | 106,175 | 99.9% | 62.83% | 0.8698 | 0.8980 |
| Multiway response | 36,358 | 34.2% | 65.73% | 0.8584 | 0.8861 |
| Bluff likelihood | 53,794 | 50.6% | 59.40% | 0.8986 | 0.9200 |
| Strategy drift | 105,227 | 99.0% | 62.81% | 0.8692 | 0.8977 |
| Postflop behavior | 42,451 | 39.9% | 67.37% | 0.6507 | 0.7955 |
| Showdown calibration | 53,794 | 50.6% | 59.40% | 0.9001 | 0.9200 |
| Fold response | 61,241 | 57.6% | 59.41% | 0.8706 | 0.9158 |
| Within-hand sequence | 97,808 | 92.0% | 66.75% | 0.7508 | 0.8950 |
Effects of player and session history
History experiment
A separate experiment compared public-state, population, player, and current-session histories. Sparse histories were shrunk toward broader distributions. I evaluated observed actions and conditional aggressive sizing separately across three training windows.
Session history improved conditional sizing over player history in all three windows. Action-prediction gains varied, including a decline in the smallest window. These results come from reused development games, so they support further investigation rather than an untouched confirmation claim.
View full size Results and limitations
Outcome & reflection
The project produced an implemented advisory system, a documented training and evaluation pipeline, and a public research report. Its clearest result is that behavior models can outperform simple priors while still requiring separate evidence before influencing strategy.
The recorded gameplay sample finished at +486.37 big blinds across 4,880 hands in 32 games: +9.97 BB per 100 hands. The curve below shows how that total developed across complete games, including the losses along the way.
This is an observed gameplay result associated with the project. Without a control group or verified recommendation use, it does not establish how much the Assistant contributed to the winnings.
Recorded gameplay
Complete-game ledger results
Observed complete-game outcomes associated with the project. The rate is 486.37 ÷ 4,880 × 100; this sample does not establish long-run profitability or the Assistant’s effect on winnings.
View all 32 game results
| Game | Hands | Net BB | Cumulative BB |
|---|---|---|---|
| 1 | 230 | 190 | 190 |
| 2 | 206 | 102.12 | 292.12 |
| 3 | 119 | 123.26 | 415.38 |
| 4 | 444 | -300 | 115.38 |
| 5 | 166 | 208.92 | 324.3 |
| 6 | 195 | -250 | 74.3 |
| 7 | 383 | 5 | 79.3 |
| 8 | 76 | 321.74 | 401.04 |
| 9 | 260 | 61.3 | 462.34 |
| 10 | 135 | 553.8 | 1,016.14 |
| 11 | 56 | 13 | 1,029.14 |
| 12 | 115 | 101.34 | 1,130.48 |
| 13 | 120 | -293.5 | 836.98 |
| 14 | 82 | 104.5 | 941.48 |
| 15 | 53 | -250 | 691.48 |
| 16 | 220 | 70.26 | 761.74 |
| 17 | 85 | 143.69 | 905.43 |
| 18 | 101 | 152.36 | 1,057.79 |
| 19 | 168 | 31.37 | 1,089.16 |
| 20 | 146 | 191.54 | 1,280.7 |
| 21 | 289 | -14.29 | 1,266.41 |
| 22 | 212 | -400 | 866.41 |
| 23 | 104 | -300 | 566.41 |
| 24 | 67 | -200 | 366.41 |
| 25 | 56 | 180 | 546.41 |
| 26 | 69 | 37.24 | 583.65 |
| 27 | 109 | -150 | 433.65 |
| 28 | 193 | -200 | 233.65 |
| 29 | 70 | 189.42 | 423.07 |
| 30 | 93 | -100 | 323.07 |
| 31 | 115 | 126.14 | 449.21 |
| 32 | 143 | 37.16 | 486.37 |