A while back, after a particularly frustrating string of online Poker games, where it seemed like I was catching nothing but garbage cards I thought it would be great to be able to go back and look over a game, hand-by-hand, to see how often I caught strong hole cards and when I did catch cards, how often I won with them.
Technically I can already do this. Most of my online playing is done at Full Tilt Poker. One of the cool features of the site is a “Hand History” which records everything done on every hand: What your starting stack is, what your hole cards are, what cards are dealt, how much you bet, what the result is… It even records any online chatting between players. For example, a sample hand looks like this (my screen name is “cabbotage”):

(If you’re familiar with Hold ‘Em, you can see that my preflop re-raise was relatively large. I was hoping to thin it down to heads up with my Jacks, but these guys had been calling stations the whole game and weren’t laying anything down.)
The information is all there, but it’s not a very user friendly format – at least not for seeing any large scale patterns. I had also just picked up Visualizing Data, Ben Fry’s new book on “Exploring and Explaining Data with the Processing Environment” and this seemed like a perfect project to dive in with. Using the Full Tilt Hand History as the raw data and working with my good friend and programming whiz, Taylor Wright, we sat down and came up with a quick sketch of what information we wanted to get out of the hand history, and what we wanted to do with it. For our first draft we wanted to start with the following information:
1. What hand is it? The Hand History gives every hand a number (43405965 in the above example) but since there are hundreds if not thousands of hands being dealt on the site every second, it’s not useful for our purposes. We wanted to be able to know how many hands we played in a given sitting or throughout a given tournament.
2. What were the cards? This is obviously a big one. Starting hands mean a lot in Hold ‘Em and the greatest player in the world isn’t going to win much being dealt Q3 offsuit all night.
3. What was the result? We were interested in three distinctions: Won, Lost and Folded Without Betting. “Losing” a hand can be a murky area. If you’ve got a good starting hand, but post flop it’s clear that your opponent has you beat, laying down a hand really isn’t “losing” – it’s a good decision. But for the sake of clarity we decided that if any bets were made during the hand and it was then folded or lost in the Showdown, then the hand was a loser. Folding from the Small or Big Blind without a bet (or folding from any other non-blind position) we considered to be “Folded Without Betting.”
The first (de-bugged) result looked like this:

It starts with the player’s name listed at the top. The first line after that is the hand number (which was an immediately useful tool to see how long most of my sessions were lasting. The next line lists the hole cards and their suits (standard notation abbreviates each face card to the first letter of the name, Q = Queen; 10 is abbreviated as T; the suits are abbreviated to the first letter of their name, h = heart). We didn’t initially set out to capture position (Button, Small Blind, Big Blind), but it turned out to be easier to grab it than to eliminate it from the result so we kept it.
For our first run through, this was a great success. Once it was clear that we could comb through the Hand History data without too much trouble, the next step was to add detail, and more importantly, put it into a visual display. After a few rounds of tweaking, the text output of our collected data looked like this:

One change we made was to simplify the hand listing. If you’re only looking at hole cards, it doesn’t matter which suits they are, just whether or not they’re of the same suit (“suited”). So (Kd Ts) would be simplified down to just KT and (9h 8h) would be simplified to 98s (as in “suited”). We also made sure they were always ordered from highest card to lowest card (KT, never TK), which made it easier to work with the data at later stages. We also started tracking chip stack along with the amount bet per hand and (most importantly for the next step), the Group.
RANKING THE STARTING HANDS
In 1988, noted poker author David Sklansky developed a Group-based system for ranking the relative strength of starting cards. He divided the hands into eight Groups with Group 1 containing the strongest hands and Group 8 the weakest (for example the Group 1 hands are AA, KK, QQ, JJ and AKs). For a better explanation of the Group system, check out this post on the subject. Because this project originally began as a way to see how often I was starting a hand with quality cards, Sklansky’s ranking system was an easy and objective system to apply. Since we could set any Group as our target, we decided for the time being that “quality” cards meant Group 4 or better.
GRAPHIC DISPLAY
The next step was to turn the text file into a graphic representation of the data. The solution was to use sparklines. Below is a sample of a 151-hand tournament represented as a sparkline.
The bars extending upwards represent Wins, the bars extending downward represent Losses and the small dashes in the middle represent Folding Without Betting.
Sparklines are a fantastic way to compress a large amounts of data into a small space. The resolution and size of the diagram really depends on what the final usage of it will be. This diagram could be compressed even smaller and still remain legible, however in a later phase of our project our goal is to make the sparkline interactive (revealing more detailed hand information) so the bars need to be wide enough (~4px or so) that one can comfortably select individual hands with the mouse.
A simple binary-outcome sparkline would record only Wins or Losses. We added a third state by creating the “Folded Without Betting” position, and then added a fourth state with the addition of color. In the above sparkline, the blue lines represent the hands where I was dealt a Group 4 hand or better (for brevity I’m just going to refer to them as Group 4 hands from now on). For reference this is a graphic showing which hands are included in Groups 1 through 4. In that graphic, the black hands one would play suited or not, the blue hands would only be played if they were suited. At a glance I can read the following information from the above sparkline:
• Out of 151 hands I only lost 3 times with Group 4 hands
• I only folded Group 4 hands 3 times without betting
• I was relatively conservative for the first 20 hands, playing almost exclusively Group 4 hands. After it apparently became clear to other people at the table that I was only playing strong hands I was able to start “loosening up” my game by playing lower ranked hands.
A couple of things to keep in mind. First, this was just a play-money game, so the level of play is not necessarily world class (mine or that of my opponents). Second, this was only a single table, 6 person tournament. I clearly start playing more hands about a quarter of the way into the game, probably because 1 or 2 players have busted out and there are now only 4 of us at the table (the hands you play 4-handed vs. 9-handed are significantly different).
CHIP STACK
Something very important that isn’t shown in the above graph is my chip stack. Not including this data leaves some critical information out of the picture. Below is a graph of just my chip stack throughout the same game:
On its own the chart gives us some useful information about my play. I slowly and steadily built my stack with minimal losses… then I took a huge loss of nearly half my stack. I built it back up rapidly in two big jumps, lost another sizable pot, and then had a slow arc of building chips and slowly loosing them again before turning it around near the end. It’s even more useful to overlay the two diagrams so you can see exactly which hands did the damage. As this is still a work in progress, I’m still experimenting with how to display the data:
Here you can see that the second and third losses were minimal. I probably raised a bit, someone re-raised a lot and I folded; same thing with the fourth loss. The fifth loss I really thought I had something, and I paid the price, losing almost half of my stack. I don’t need to play-by-play the whole game for you, feel free to look it over yourself. I will point out that in the latter half of the game, my slowly dwindling chip stack was at least partially due to the fact that I wasn’t catching good cards (see all the grey “Fold Without Betting” lines) and was just being slowly Blind-ed out of my money.
WHERE TO GO FROM HERE
This is an ongoing project and we’re still experimenting with ways to display the data, and even what information we want to show. Something which is not shown in the above sparkline is position. In a 9 handed Hold ‘Em game, position is almost as important as what cards you’re dealt. Showing not only Wins and Losses, but how many of those W/L were in early position vs. late position would be another critical and important piece of information. Unfortunately, so far most of the data we’re working with has been in small, 1 table tournaments where very quickly there are only 2 or 3 opponents and the Blinds and Button come up so frequently that they become irrelevant. 150 hands at a 9 handed cash game or a multi-table tournament where the number of people at a table didn’t dip below 9 until the final table would be a better way to see the effect of position.
As I mentioned, the project is still evolving, to date these are the challenges we’ve been working out.




{ 3 comments… read them below or add one }
Hi,
You made a post about this on cardschat a while ago, and I’m not sure what sparked my memory (no pun intended), but I remembered the thread and went to check it out today, and that of course led me here. The sparklines are itneresting and look great. I found your other non-poker desings interesting too.
I’m not affiliated with them in any way, but programs like Poker Tracker could definitely use your expertise. I can see some pretty interesting applications with poker and your graphic representations. I say you contact a few people and see where it leads you!
Anyways, just thought I’d chime in and let you know I like your style of design
-ChuckTs of cardschat.com
Hi
Great post. I particularly like the way that you have been able to compress the data into a spark-line and then take that to the next level by superimposing your chip stack at the time onto it.
I hope to be able to do something simmilar with my results.
By the way, the layout of your blog is awesome, what theme did you use?
Dave, thanks for the message. If you have a game or two you’d like to generate a sparkline with, let me know or just fire it over via email. It just has to be from Full Tilt (and the program doesn’t generate the chip stack graph yet.)
Other than that the theme I’m using is a modified version of Box Set 1.2 by Paddy Ryan
{ 1 trackback }