looking for help in creating my own stats

Forum for users that want to write their own custom queries against the PT database either via the Structured Query Language (SQL) or using the PT3 custom stats/reports interface.

Moderator: Moderators

looking for help in creating my own stats

Postby niall » Wed Dec 30, 2009 6:13 am

Rather than beat my head against a wall for days since I have basically no experience at stuff like this, I figured I might as well start by describing the stats I want to create here and hope that you guys might point me in the right direction.

All of these stats are calculated from every opponent I have in my database; I’m not interested right now in individual opponents. All of these stats right now are only regarding the flop (I might look at the turn and river later). All of these stats are of the standard variety: (how many times did a player do some action in a particular situation / how many times was a player in this situation).

I want to define a player’s “condition” by 6 different parameters, so that every possible condition would be defined something like this: Parameter 1: 8, Parameter 2: 3, Parameter 3: 0, and so on. Here is what I want the 6 parameters to be:

1. How many players were dealt into the hand: 10, 9, 8, 7

2. How many players saw the flop: 2, 3, 4, 5, …

3. A summary of the preflop betting and player’s action: checked BB, completed SB, limped, called raise, cold-called raise, raised, called 3bet, 3bet, called 4bet, 4bet.

4. The relative position of the player: 1, 2, 3, 4, 5

5. The board type: I haven’t fully thought out yet what I want the different options to be here.

6. What the player is facing: first to act, checked to, bet into, bet and called into, raised into, raised and called into.

So all of the different conditions would read something like:
The number of times any player was in an 8-handed game, where he called a raise preflop, and 3 players saw the flop, and his relative position was 2nd to act, and the board was of type 4, and the player was checked to.

For each of these conditions then, I want to calculate the percentages of each of the possible actions the player could have made. So I divide the number of times a player was in Condition x and then did some action, by the number of times a player was in Condition x. For the condition given above it might be something like: check – 42%, bet – 58%.

Some of you may be thinking that with this precise a set of criteria there won’t be enough data to make any of the stats meaningful. But first of all, my database is pretty large (hundreds of thousands of hands). Second of all, some of these combinations aren’t even possible and will be excluded (like 2 players seeing the flop and having a relative position of 3). And third of all, a lot of these conditions will be so rare that I don’t really care that much about them anyways (like 4+ players seeing the flop on a capped preflop).

Any help or input would be greatly appreciated.
niall
 
Posts: 2
Joined: Wed Dec 30, 2009 6:01 am

Re: looking for help in creating my own stats

Postby WhiteRider » Wed Dec 30, 2009 6:33 am

I'll give you some database fields to check your conditions to get you started..
You'll need to build a separate stat for each of the combinations you want to display.

1. holdem_hand_summary.cnt_players
2. holdem_hand_summary.cnt_players_f

3. You'd need to build each of these expressions explicitly, so have a look at what fields some of the existing stats use, and also the "action strings" stuff in this post.

4. Relative position to what, exactly? You can get their position relative to the button from:
holdem_hand_player_statistics.position
If you want to know about position relative to the preflop aggressor you'll need to use the above field in combination with:
holdem_hand_player_detail.val_p_raise_aggressor_pos
Alternatively you can see if the player was last act (absolute position) on the flop:
holdem_hand_player_detail.flg_f_has_position

5. holdem_hand_summary.card_1 / 2 / 3

6. As in 3, you can see how to get this information by looking at other stats.
If there's anything specific you can't work out please ask.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: looking for help in creating my own stats

Postby niall » Tue Jan 12, 2010 12:27 pm

Thanks for the info, but I’m still having a little trouble with a couple things.

Regarding relative position, what I’m hoping for is a description of the player’s position relative to the other players who saw the flop. So for example, if three players see the flop and the player is neither under the gun nor last to act, his relative position would be 2 (or 1 if the button (or under the gun, depending on which direction your counting) is counted as 0). I know how to do this when there’s only three players who saw the flop, by simply saying NOT flg_f_has_position AND NOT flg_f_first, but I don’t know how to do it (or even if it’s possible) when there’s 4 or more players on the flop. For example, if 4 players see the flop, how do I distinguish between the player who is second to act and the player who is third to act?

As for 6 (what the player is facing), I see how to determine a broad description of what the player is facing, like facing a bet or facing a raise, but I’m hoping for a more precise description. So for example if 3 players see the flop and the player is in position, is it possible to distinguish between facing a check-bet and a bet-fold from the two players in front?

Thanks again.
niall
 
Posts: 2
Joined: Wed Dec 30, 2009 6:01 am

Re: looking for help in creating my own stats

Postby kraada » Tue Jan 12, 2010 12:36 pm

With 4 players there is no way currently to pick out who is second to act and who is third to act.

If you're in position on the flop and facing a bet, you can use holdem_hand_player_detail.val_f_bet_aggressor_pos to find the position of the bettor.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY


Return to Custom Stats, Reports, and SQL [Read Only]

Who is online

Users browsing this forum: No registered users and 0 guests