As someone who has played poker my entire life as well as a programmer, and have drifted passively into playing online poker recently over the real game. I found this fascinating and hadn't really considered taking the data science route to playing until I read this article as it's more of a hobby. I always have a minimum I'm willing to walk away losing should I do badly, however this approach has changed my view.
Does anyone else on HN have more resources like this, applying data science to poker. I will google, but on forums like this one, I find personally recommended resources to be very helpful.
I don't have any specific resources on data science, but there are a lot on here about AI in poker (which I reckon is also a kind of data science): http://poker-ai.org/phpbb/
Holdem Manager is still the best program for it I believe, but it only works for holdem. You're out of luck if that game bores you.
It is most useful for analysing your own game - you have access to your entire hand history so it is extremely valuable for finding out your weaknesses.
I've used Pokertracker Stud in the past, and I recall they had an Omaha version as well. This was ~10 years ago however, not sure if either are still available.
Rad, this is a very interesting rabbit hole for me I stumbled upon today. Keen to combine my programming and poker knowledge for some minor profit and fun mroe than anything else.
back in the day i used PokerTracker a lot, good software. back before the big poker sites got shut down I had a side project that was a hook library/bot/hand history logger.
Data science really has somewhat limited application to poker. Or at least, it's a very big hammer for a pretty small screw. The two big stats he talks about (VPIP and PFR) were well known more or less as soon as the first tracking software came out around 2003 or so, and they're very simple counting stats. Those two stats alone probably cover 90% of what you ever need to know to profile a player. I'd guess that the next most important stat is WTSD, "went to showdown", which is basically a measure of how often someone folds postflop. Everything after that is slicing a small amount of data into increasingly smaller slices, at least as far as opponent modeling goes.
Even for your own hands, where you see every result, there's so much noise on the individual hand level that it's hard to do good direct comparisons. You can easily have a million hand sample where, for example, you make more money with 22 than 88. Some people will (most likely erroneously) conclude that they there's something wrong with how they play 88. The more likely explanation is that even with a million hands, once you break out how often you get dealt 22, choose to play it preflop, flop some hand where you'll continue (most likely a set), have the other person in the pot have enough hand where they'll continue far enough to generate a big pot, and then play some sequence where you actually do generate a big pot, you're down to maybe a dozen instances, so a single outlier influences your results a ton.
tl;dr - don't worry about data science. If you play online, use one of the standard HUDs, look at VPIP, PFR, WTSD, and ignore everything else except overall win rate and standard deviation until you're damn sure you know what you're talking about.
Nobody is playing for a living at those stakes, I guess he was still learning at that time. It would make his basic analysis easier to bear out though. At those stakes the bad players are loose and passive, and simply playing tight and aggressive is a winning strategy.
straightforward tight-aggressive is a slightly losing strategy at these stakes due to rake (mostly because the other 8 players at the table are also using it)
Also, at 25nl there are many who play for living, as $500 is a decent salary to them
I sent this article to my brother and he also misread that paragraph. The games he collects data from are as he says, "a small fraction of the hands he plays" So as a pro I'd expect he's earning a lot more, but for the cases of this blog post and probably personal preference he doesn't show the real totals of all hands across all games.
At 600 hands per hour it would take that long to play them regardless of whether this is a small fraction of the total hands. The rate per hour would be wrong if these are hands where he won less than usual, but in that case he's making a profound (but common) data science mistake by drawing conclusions from a biased sample.
The poker competition you linked to is really more academics-oriented, and last time I checked, was consistently won by the University of Alberta.
For a more "real-world" example -- AIs that were actually used in live online poker environments, competing against each other -- there was only one that I know of. It was hosted by the creator of the (apparently now defunct) WinHoldEm software, Ray E. Bornert II. It never ran again, only a small handful of the more experienced bot authors attended, and turnout was poor, with the highest max buy in at $100 ( http://robopoker.blogspot.com/2007/12/pokerbot-world-champio...). It was called the 2007 Poker Bot World Championship (PBWC).
A lot of the low stakes actual money games these days likely have bots at the tables. You won't read about it, but if you play against them you can pickup clues.
> ‘Voluntarily Put Money in Pot’ (VP$IP) percentage...is the frequency with which a player plays a hand when first given an opportunity to bet or fold.
Does a call count, or does it have to be an initial bet or raise?
Indeed. Call me a snob, but I am sitting in 2 to 3 interviews weekly at the moment (looking for a big data specialist) and everyone is a "Data Scientist":
me: You state on your CV that you are a data scientist
I guess Michael Faraday, Thomas Edison, Charles Darwin, Gregor Mendel, TH Huxley and James Prescott Joule weren't scientists then. And Richard Leakey isn't one either.
I guess Michael Faraday, Thomas Edison, Charles Darwin, Gregor Mendel, TH Huxley and James Prescott Joule weren't scientists then. And Richard Leakey isn't one either.
As far as I understand, they were not data scientists in the contemporary meaning of the word. At least, they don't have the training, skills and experience I am recruiting for.
You indicated that you must have a PhD to be a data scientist. The world is full of people without Phds who are better scientists in every field than the typical Phd.
You are being a snob. There's no degree requirement to be called a data scientist. Even if there were, why would you exclude a B.S. or an M.S.? It's not like they're calling themselves a Doctor.
You'd be stupid to market yourself as a data specialist when every startup is looking for a data scientist.
There's no degree requirement to be called a data scientist.
There is for one of the positions I am recruiting for.
Even if there were, why would you exclude a B.S. or an M.S.?
Because I am looking for someone with a Phd in Data Science. How stupid of me, for excluding people that don't have the skills I need for my job.
You'd be stupid to market yourself as a data specialist when every startup is looking for a data scientist.
I'd be stupid for hiring a data specialist, when what I am looking for is a data scientist. I'd be even stupider for hiring someone that is trying to pass themselves off as a data scientist with Phd, when they don't actually have one. I recently interviewed someone with "12 years production hadoop experience" (seriously), claiming to have a "data science Phd" (doesn't exist as such) and when asked "can you please explain the relationship between hbase, hadoop, and hdfs" (yes, there is a reason for asking this question in this way) I had to listen to essentially a salespitch for Hortonworks, and to be told "hdfs has nothing to do with hadoop" <-- this shit, many times a week.
But this isn't a problem with the industry itself, it's how you've set yourself up for poor matches. Why don't you title the position "Data Scientist, Senior/Chief/etc. (PhD req)." It'll cut through at least half of the cruft right away.
But really, it looks like you need to hire a new recruiter. If you're wasting your time interviewing a Hortonworks entry dev when you want a guy with a PhD, the recruiter is not doing their job.
What's the essential scientific skillset you see developed in PhD programs, and why do you think it's unlikely to find it in people who don't have that credential?
Cool little trick, if you're strictly curious about knowing which hands rank where in relation to which other hands (say in an AI or whatever).
While there are C(52, 5) different hands you can have, having 4 diamonds and a heart is the exact same thing as 3 clubs and 2 hearts, etc. so it collapses down to ~2.5k hands.
Now the next observation we make is that for most hands, suit doesn't matter, but if it does we still need a way to distinguish it, but again, a flush in hearts is the same as a flush in spades in terms of card ranking. The trick we now pull out is the Fundamental Theorem of Arithmetic, which says that for some natural number N, N can be factored into primes in exactly one way, excluding permutations of the factors.
We take advantage of this and assign each card a prime number.
2=2 3=3 4=5 ... A=41
Now, by multiplying the prime numbers together, we get things like a 2 3 A K Q hand is 2 * 3 * 41 * 39 * 37, and if they are all the same suit, you multiply by 43. You can then take these 2.5k hashes, rank them against each other in a lookup table, and know in constant time for the number of hands how hands rank against each other by just multiplying their card's values together with either 1 or 43 if same suit and seeing where it falls in the list.
I realize expected value is more widely used as the basis for these types of systems, but I always thought that was a fun trick.
> Why not just hash the hand itself? "3459To" where o stands for off suit?
Permutable hashes - you could just sort them and hash again, but the prime multiply hashing is pretty neat way of mapping all items in any order to the same hash code.
Because 3459T is equivalent to 345T9 and 34T59 and all the other permutations.
You need to either hash all the permutations (making your lookup table 5! times bigger) or sort the hand by card value. It is faster to multiply the 5 prime factors in linear time rather than the N log N of sorting.
That makes sense. I was making the assumption that hands are given in order. For example, when generating all hands, your inner loops only start at the current index of the parent loop.
The purpose isn't to generate the ranking list. The purpose is to evaluate hands. The list is a one-time cost however you make it, but evaluating the randomly dealt cards would have the ongoing cost of sorting every time if not for the prime-factors trick.
Yea, I guess I'm not convinced that the prime-factors is faster than sorting. Sure, linear time for prime multiplication, but you still have to look up the prime number in a lookup. The question comes down to what the coefficient is in front of N for prime factor method and in front of N log N for sorting. As N=5, the coefficient ratio is pretty small to still warrant using sorting. Also, using Radix sorting makes things even more fuzzy.
In practice, I believe most fast hand value evaluators just use a lookup table, treating each hand as a 52 bit (or 64 with 12 wasted bits, most likely) bitset with 5 bits set to 1 to indicate the cards.
You would have those rankings precomputed beforehand. So you'd know A 2 3 4 5 is one straight, but its computed hash would have a higher ranking than 2 3 4 5 6 in the lookup table. The A straight might go to 735 and the 2 3 4 5 might go to 785 or something There is work to do in the construction of the list, but that happens once, and likely gets loaded from disk after it's created out of band.
> " I used the data at this level from 2013 where I won $1,913.13 over 387,373 hands,"
This does not seem like a lot of money to earn for playing 387k hands!
Not a criticism just an observation - but surely this amount of effort could be better spent elsewhere? Purely from a money-making perspective, obviously there is an element of enjoyment here which might change the picture significantly.
That was my first thought when I read that. Just from doing some quick math in my head (which may very well be wrong, I'm not fully awake yet), that's roughly $1 earned per 200 hands. At ~600 hands per hour (IIRC, from the article), that's an average of $3 per hour. One could earn more working at a minimum-wage fast food job (although it wouldn't be as fun or interesting).
For professional low level poker players, a good deal of their income comes from rakeback. That is, for every hand, the site makes $N (the "rake"), and the player gets back X% of N/players, where X scales according to the amount of volume put in. I'm a bit out of the loop but you can assume that N is around $3 and X is probably in the 35% range.
Some people semi-derisively refer to these people as "rakeback pros", in that you can break even (or even lose a little bit) in your poker results, and still make a living wage from the rakeback alone.
Also, 387k hands probably takes less time to play than you think. Many online grinders play upwards of 1000 hands/hr - 20+ tables concurrently X 50-150 hands/hr.
61 comments
[ 4.4 ms ] story [ 121 ms ] threadDoes anyone else on HN have more resources like this, applying data science to poker. I will google, but on forums like this one, I find personally recommended resources to be very helpful.
It is most useful for analysing your own game - you have access to your entire hand history so it is extremely valuable for finding out your weaknesses.
Databases of IRC poker matches hands: http://web.archive.org/web/20110205042259/http://www.outflop...
(Actually uses web-archive and handhq.com data.)
For reading: http://poker.cs.ualberta.ca/publications.html
of course, the state of the art in this subject is this crew: http://poker.cs.ualberta.ca/
i have no spare time but after reading this i know i'm going to have even less because a new poker project is starting...
Even for your own hands, where you see every result, there's so much noise on the individual hand level that it's hard to do good direct comparisons. You can easily have a million hand sample where, for example, you make more money with 22 than 88. Some people will (most likely erroneously) conclude that they there's something wrong with how they play 88. The more likely explanation is that even with a million hands, once you break out how often you get dealt 22, choose to play it preflop, flop some hand where you'll continue (most likely a set), have the other person in the pot have enough hand where they'll continue far enough to generate a big pot, and then play some sequence where you actually do generate a big pot, you're down to maybe a dozen instances, so a single outlier influences your results a ton.
tl;dr - don't worry about data science. If you play online, use one of the standard HUDs, look at VPIP, PFR, WTSD, and ignore everything else except overall win rate and standard deviation until you're damn sure you know what you're talking about.
You were meaning nail? Or was it intentional?
There are no sharks at those tables.
Also, at 25nl there are many who play for living, as $500 is a decent salary to them
Does such a thing exist? Some preliminary searches didn't bring much up apart from one-off experiments. [EDIT found a recent article about this https://www.scientificamerican.com/article/time-to-fold-huma... which talks about http://www.computerpokercompetition.org/]
Another interesting one would be a table of 8 players. Half AI half professionals but no one knows who is who.
For a more "real-world" example -- AIs that were actually used in live online poker environments, competing against each other -- there was only one that I know of. It was hosted by the creator of the (apparently now defunct) WinHoldEm software, Ray E. Bornert II. It never ran again, only a small handful of the more experienced bot authors attended, and turnout was poor, with the highest max buy in at $100 ( http://robopoker.blogspot.com/2007/12/pokerbot-world-champio...). It was called the 2007 Poker Bot World Championship (PBWC).
Does a call count, or does it have to be an initial bet or raise?
Someone with Vpip: 35 and Pfr: 5 would be an extremely passive weak player.
me: You state on your CV that you are a data scientist
Candidate: Yes
me : What is your Phd in?
Candidate : I don't actually have a Phd
me : <sigh> right, no scientist.
I hate job interviews
As far as I understand, they were not data scientists in the contemporary meaning of the word. At least, they don't have the training, skills and experience I am recruiting for.
It does if you have a Phd in a data science related field.
Of course I know what qualifications they have. I don't know what "fault" you are talking about. Fault for what?
You'd be stupid to market yourself as a data specialist when every startup is looking for a data scientist.
There is for one of the positions I am recruiting for.
Even if there were, why would you exclude a B.S. or an M.S.?
Because I am looking for someone with a Phd in Data Science. How stupid of me, for excluding people that don't have the skills I need for my job.
You'd be stupid to market yourself as a data specialist when every startup is looking for a data scientist.
I'd be stupid for hiring a data specialist, when what I am looking for is a data scientist. I'd be even stupider for hiring someone that is trying to pass themselves off as a data scientist with Phd, when they don't actually have one. I recently interviewed someone with "12 years production hadoop experience" (seriously), claiming to have a "data science Phd" (doesn't exist as such) and when asked "can you please explain the relationship between hbase, hadoop, and hdfs" (yes, there is a reason for asking this question in this way) I had to listen to essentially a salespitch for Hortonworks, and to be told "hdfs has nothing to do with hadoop" <-- this shit, many times a week.
But really, it looks like you need to hire a new recruiter. If you're wasting your time interviewing a Hortonworks entry dev when you want a guy with a PhD, the recruiter is not doing their job.
While there are C(52, 5) different hands you can have, having 4 diamonds and a heart is the exact same thing as 3 clubs and 2 hearts, etc. so it collapses down to ~2.5k hands.
Now the next observation we make is that for most hands, suit doesn't matter, but if it does we still need a way to distinguish it, but again, a flush in hearts is the same as a flush in spades in terms of card ranking. The trick we now pull out is the Fundamental Theorem of Arithmetic, which says that for some natural number N, N can be factored into primes in exactly one way, excluding permutations of the factors.
We take advantage of this and assign each card a prime number. 2=2 3=3 4=5 ... A=41
Now, by multiplying the prime numbers together, we get things like a 2 3 A K Q hand is 2 * 3 * 41 * 39 * 37, and if they are all the same suit, you multiply by 43. You can then take these 2.5k hashes, rank them against each other in a lookup table, and know in constant time for the number of hands how hands rank against each other by just multiplying their card's values together with either 1 or 43 if same suit and seeing where it falls in the list.
I realize expected value is more widely used as the basis for these types of systems, but I always thought that was a fun trick.
Edit: I missed
>>> rank them against each other in a lookup table
I'm just confused about the prime factors thing now. Why not just hash the hand itself? "3459To" where o stands for off suit?
Permutable hashes - you could just sort them and hash again, but the prime multiply hashing is pretty neat way of mapping all items in any order to the same hash code.
You need to either hash all the permutations (making your lookup table 5! times bigger) or sort the hand by card value. It is faster to multiply the 5 prime factors in linear time rather than the N log N of sorting.
For example how do these two hands compare?
A 2 3 4 5 2 3 4 5 6
Maybe there is a way we can extend this to work for straights.
This does not seem like a lot of money to earn for playing 387k hands!
Not a criticism just an observation - but surely this amount of effort could be better spent elsewhere? Purely from a money-making perspective, obviously there is an element of enjoyment here which might change the picture significantly.
Some people semi-derisively refer to these people as "rakeback pros", in that you can break even (or even lose a little bit) in your poker results, and still make a living wage from the rakeback alone.
Also, 387k hands probably takes less time to play than you think. Many online grinders play upwards of 1000 hands/hr - 20+ tables concurrently X 50-150 hands/hr.