Decision Trees and State Machines
Learning objectiveSeparate street, stack depth, and betting context into explicit branches.
Understand the idea
A decision tree makes the path visible: first identify street, then prior aggression, then effective stack, then cards and legal actions. Unlike isolated rules, the tree expresses context before selecting a leaf action. A state machine can also track whether your bot was preflop aggressor and whether it has already acted this street.
The tree can grow too large. Keep branches small and test every leaf. Use the observation's public actions rather than assuming that a prior hand's state still applies.
At the poker table
Preflop → facing raise → short effective stack → premium pair → consider legal all-in; otherwise evaluate call price. Postflop → not facing bet → consider check or a bounded value bet.
Code and decision sketch
Decision treestreet?
├─ preflop → facing_raise? → short_stack? → premium? → legal action
└─ postflop → facing_bet? → estimate price and equity → legal actionCommon mistake
Do not let a stale local flag such as 'I was aggressor' survive into a new hand.
Try it yourself
Draw a three-level tree for check, call, and fold decisions on the flop.
