Page 1 of 16

3Bet Preflop vs Hero

PostPosted: Thu Jul 11, 2013 1:43 pm
by BillGatesIII
\
This thread is about creating a custom 3Bet Preflop vs Hero stat, not about the usefulness of such stats.
/

It took a long time but I finally managed to create a vs Hero stat that performs almost as good (or as bad) as any other custom stat.

The trick is to define a vs Hero stat as a subset of the 'normal' stat. I'll use the Preflop 3Bet stat as an example.

The column cnt_p_3bet, which counts the number of times a player 3bets preflop, is defined like this.
Code: Select all
sum(if[cash_hand_player_statistics.flg_p_3bet, 1, 0])

Now we have to find the subset of this stat. The only way an opponent can make a 3bet against Hero, is if Hero made a 2bet. This is stored in de database field cash_hand_player_statistics.flg_p_first_raise (or tourney_hand_player_statistics). Now, one of the neat things of PT4 is that every hand is saved multiple times in cash_hand_player_statistics. For instance, if six players are dealt in a hand, there will be six different records for that hand in cash_hand_player_statistics. And only one of these hands will have flg_hero set to true.

The original column combined with these two restrictions results in this simple and elegant cnt_p_3bet_vs_hero column.
Code: Select all
sum(if[cash_hand_player_statistics.flg_p_3bet and exists
  (select 1
   from cash_hand_player_statistics hero
   where hero.id_hand = cash_hand_player_statistics.id_hand
   and hero.flg_hero
   and hero.flg_p_first_raise), 1, 0])


And the opportunity column cnt_p_3bet_opp_vs_hero.
Code: Select all
sum(if[cash_hand_player_statistics.flg_p_3bet_opp and exists
  (select 1
   from cash_hand_player_statistics hero
   where hero.id_hand = cash_hand_player_statistics.id_hand
   and hero.flg_hero
   and hero.flg_p_first_raise), 1, 0])

Because id_hand is an indexed field, retrieving the records of the hand is fast and the select only has to check for a maximum of the number of players dealt in the hand.

In my small database (350k hands), the stat is fast enough to use in a table group. I'm curious how it will perform in larger databases. And of course, I would like to hear if I'm right and this stat will give the correct numbers :mrgreen:

Re: 3Bet Preflop vs Hero

PostPosted: Thu Jul 11, 2013 4:08 pm
by kraada
At first glance I don't see anything that will keep it from working, though even though it's indexed it's still a join on our largest database table, so I can't vouch for performance as your database gets larger.

Re: 3Bet Preflop vs Hero

PostPosted: Wed Jul 24, 2013 4:39 pm
by Jack90
Can u create also a stat for fold to heroes 3bet? I know, I won't get big Samplesizes on this stat, but I need this stat just for the SB in SNGs, where I will get a big amount of hands for the most active regulars (I play hypers, so its quite a big number of hands I will get).

I think it works out really similar to this stat, but I would need first something like the "hero.flg_p_first_raise" colum for "hero first 3bets", and I dont know where to find this kind of commands.

I tried already to write you a PM BillGates, but I am not allowed to. Maybe you can add me in Skype, my nick is gdr-j4ck .

Re: 3Bet Preflop vs Hero

PostPosted: Wed Jul 24, 2013 5:02 pm
by BillGatesIII
Do you want it for hero in the small blind? Or villain in the small blind? And is this for heads up? Or six max?

Re: 3Bet Preflop vs Hero

PostPosted: Wed Jul 24, 2013 5:43 pm
by BillGatesIII
You can try this general fold to hero's 3bet preflop. Made it from the top of my head and didn't test it so don't know if it's any good.

cnt_p_face_3bet_fold_vs_hero
Code: Select all
sum(if[cash_hand_player_statistics.enum_p_3bet_action = 'F' and exists
  (select 1
   from cash_hand_player_statistics hero
   where hero.id_hand = cash_hand_player_statistics.id_hand
   and hero.flg_hero
   and hero.flg_p_3bet), 1, 0])

cnt_p_face_3bet_vs_hero
Code: Select all
sum(if[cash_hand_player_statistics.flg_p_3bet_def_opp and exists
  (select 1
   from cash_hand_player_statistics hero
   where hero.id_hand = cash_hand_player_statistics.id_hand
   and hero.flg_hero
   and hero.flg_p_3bet), 1, 0])

Re: 3Bet Preflop vs Hero

PostPosted: Wed Jul 24, 2013 6:00 pm
by Jack90
Thx a lot !

I will test it tomorrow and tell then, if it worked out :)

Re: 3Bet Preflop vs Hero

PostPosted: Mon Aug 12, 2013 1:38 pm
by pt4pt4pt4
BillGatesIII wrote:Do you want it for hero in the small blind? Or villain in the small blind? And is this for heads up? Or six max?


So with these stats, I would then select in item properties which position that I need to be in order to be counted?

Re: 3Bet Preflop vs Hero

PostPosted: Mon Aug 12, 2013 4:17 pm
by BillGatesIII
If you want to specify the position of hero, you'll have to do that in the stat expression. If you want to specify the position of the opponent, you can use the Position property.

Re: 3Bet Preflop vs Hero

PostPosted: Thu Aug 22, 2013 11:41 pm
by pt4pt4pt4
I tried this from a HU SNG in which I had previous hands on the player. It just counts the 3bet of Villain as a reg stat. This stat did block my values so the
and hero.flg_p_first_raise is working.

What was different tho, was that your OPP only calculated the present session opps of Villains 3 bet while the orig 3 bet opp stat counted all the previous SNG games hands.

cnt_p_3bet_HERO

Code: Select all
sum(if[tourney_hand_player_statistics.flg_p_3bet and exists
  (select 1
   from tourney_hand_player_statistics hero
   where hero.id_hand = tourney_hand_player_statistics.id_hand
   and hero.flg_hero
   and hero.flg_p_first_raise), 1, 0])


cnt_p_3bet_opp_HERO

Code: Select all
sum(if[tourney_hand_player_statistics.flg_p_3bet_opp and exists
  (select 1
   from tourney_hand_player_statistics hero
   where hero.id_hand = tourney_hand_player_statistics.id_hand
   and hero.flg_hero
   and hero.flg_p_first_raise), 1, 0])

Re: 3Bet Preflop vs Hero

PostPosted: Fri Aug 23, 2013 9:49 am
by BillGatesIII
pt4pt4pt4 wrote:What was different tho, was that your OPP only calculated the present session opps of Villains 3 bet while the orig 3 bet opp stat counted all the previous SNG games hands.

Could you please explain this more in detail? Because it should count all the opportunities this opponent had to make a 3bet against hero. Not only from this session (assuming you are displaying lifetime stats and not session stats).

highfalutin