fold to donkbet raise stat

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

fold to donkbet raise stat

Postby js2002 » Wed Feb 11, 2009 2:58 pm

Hi,

does a stat "fold to donkbet raise" exist?
js2002
 
Posts: 1502
Joined: Fri Feb 15, 2008 5:44 am
Location: Germany

Re: fold to donkbet raise stat

Postby kraada » Wed Feb 11, 2009 4:02 pm

You mean when you donkbet, then get raised, and fold to a raise? I'm not aware of that stat being built, but it shouldn't be too hard to build.

Duplicate the cnt_f_donkbet column, call it cnt_f_donkbet_face_raise, add "AND holdem_hand_player_statistics.flg_f_face_raise" to the beginning of the if[] statement. Then duplicate that stat and change the name to cnt_f_donkbet_face_raise_fold and add "AND substring(id_actions_f.id_action from 2 for 1 = 'F')" to the if statement. Put the former over the latter in a new stat, fill in the description/format tab/etc and you'll have your stat.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: fold to donkbet raise stat

Postby stevi3p » Thu Feb 12, 2009 5:35 am

I created a stat this does this - it's in the repository. It's called: "Donk Flop and Fold to Raise". The stat is as follows:

cnt_f_donk_fold = sum(if[ holdem_hand_player_statistics.flg_p_face_raise AND holdem_hand_player_detail.flg_f_open and substring(lookup_actions_f.action from 1 for 2) = 'BF' AND NOT holdem_hand_player_statistics.flg_f_cbet_opp AND (holdem_hand_player_detail.val_p_raise_aggressor_pos < holdem_hand_player_statistics.position AND (holdem_hand_player_detail.val_p_raise_aggressor_pos != (holdem_hand_summary.cnt_players-1))) , 1 , 0])

cnt_f_donk_fold_opp = sum(if[ holdem_hand_player_statistics.flg_p_face_raise AND holdem_hand_player_detail.flg_f_open_opp and flg_f_face_raise AND NOT holdem_hand_player_statistics.flg_f_cbet_opp
AND (holdem_hand_player_detail.val_p_raise_aggressor_pos < holdem_hand_player_statistics.position AND (holdem_hand_player_detail.val_p_raise_aggressor_pos != (holdem_hand_summary.cnt_players-1))) , 1 , 0])
Donk Flop And Fold = (cnt_f_donk_fold / cnt_f_donk_fold_opp) * 100

Any feedback greatly appreciated. Looking at it, it will only report a donk bet in non 3bet pots. Given the dynamic in 3-bet pots are so different, I think this is pretty reasonable. Not sure if the way I checked for position is that comprehensive though - I think I based it off an earlier stat. Kraada's approach might well be better. If so, and if you create the stat, could you share it here or upload it to the repository please? Thanks.

Steve
stevi3p
 
Posts: 71
Joined: Thu Mar 13, 2008 3:00 pm

Re: fold to donkbet raise stat

Postby kraada » Thu Feb 12, 2009 11:31 am

Yours should work in all cases except where you're on a heads up table as a heads up table is the only time position 9 has position on position 8 postflop (as the small blind is on the button when playing heads up).
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: fold to donkbet raise stat

Postby preparac » Wed Mar 11, 2009 2:29 pm

kraada wrote:You mean when you donkbet, then get raised, and fold to a raise? I'm not aware of that stat being built, but it shouldn't be too hard to build.

Duplicate the cnt_f_donkbet column, call it cnt_f_donkbet_face_raise, add "AND holdem_hand_player_statistics.flg_f_face_raise" to the beginning of the if[] statement. Then duplicate that stat and change the name to cnt_f_donkbet_face_raise_fold and add "AND substring(id_actions_f.id_action from 2 for 1 = 'F')" to the if statement. Put the former over the latter in a new stat, fill in the description/format tab/etc and you'll have your stat.


Shouldn't this be

AND substring(lookup_actions_f.action from 1 for 2) = 'BF'
or
AND substring (lookup_actions_f.action LIKE '_F'
instead of
AND substring(id_actions_f.id_action from 2 for 1 = 'F')"

I still don't get exactly what is the difference between the lookup_actions field an the id_actions field and I also don't get exactly what is the difference of from 2 for 1 and from 1 for 2 ... And its little bit hard to learn all this SQL stuff ...
preparac
 
Posts: 323
Joined: Thu May 15, 2008 6:23 am

Re: fold to donkbet raise stat

Postby kraada » Wed Mar 11, 2009 2:44 pm

Sorry, you are correct it should be lookup_actions_f.id_action, I'm not sure what I was thinking when I wrote it the other way.

You could use from 1 for 2 'BF' if you're already using from 1 for 1 'B' to see if you bet. If you're using flg_f_bet, though, that's not really necessary and you only really need to check the fold.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: fold to donkbet raise stat

Postby WhiteRider » Wed Mar 11, 2009 6:29 pm

"FROM x FOR y" means from character x for y characters.
So if the string is "abcdef":
from 2 for 3 = 'bcd'
from 4 for 1 = 'd'
from 1 for 2 = 'ab'
from 2 for 1 = 'b'
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: fold to donkbet raise stat

Postby preparac » Thu Mar 12, 2009 3:42 am

So in this case
substring(lookup_actions_f.action from 1 for 2) = 'BF'
'from 1 for 2' means that PT3 is looking for hands where I first Bet the and then Fold the Flop

substring(lookup_actions_f.action from 1 for 1) = 'BF'
.. would mean PT3 is looking for hands where I bet the Flop as first action regardless of what happened after?

and substring(lookup_actions_f.action from 2 for 1) = 'BF' (or 'XF' ... 'CF' ...?
.. would mean PT3 is looking for hands where I Fold the Flop as seccond action regardless of what was my first one?

By the way: In the FAQ you give us a link to sql to investigate further the meaning of this substring expressions. Honestly, this document is to much for even a very interested but only ordinary skilled PT3 user like me. It would be really nice, if you could give us some day a small, easyily understandable FAQ about how to use the most useful substring expressions (LIKE, % ... and so on )

thanks
preparac
 
Posts: 323
Joined: Thu May 15, 2008 6:23 am

Re: fold to donkbet raise stat

Postby kraada » Thu Mar 12, 2009 9:20 am

The 'for' number tells you how long the string is supposed to be.

So if you said "from x for y" the string starts counting at the xth letter, and the string it looks at is y letters long.

When the substring is from 2 for 1, 'BF' is malformed and will never return a true value as from 2 for 1 will always return a 1 character string.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: fold to donkbet raise stat

Postby WhiteRider » Thu Mar 12, 2009 10:56 am

preparac wrote:So in this case
substring(lookup_actions_f.action from 1 for 2) = 'BF'
'from 1 for 2' means that PT3 is looking for hands where I first Bet the and then Fold the Flop

substring(lookup_actions_f.action from 1 for 1) = 'BF'
.. would mean PT3 is looking for hands where I bet the Flop as first action regardless of what happened after?

and substring(lookup_actions_f.action from 2 for 1) = 'BF' (or 'XF' ... 'CF' ...?
.. would mean PT3 is looking for hands where I Fold the Flop as seccond action regardless of what was my first one?

As Kraada says, not quite.
The first one is right:
substring(lookup_actions_f.action from 1 for 2) = 'BF'

But the other two aren't.
substring(lookup_actions_f.action from 1 for 1)
..is comparing only the first character of lookup_actions_f.action, so will always be a 1 character string so you need to check like this:
substring(lookup_actions_f.action from 1 for 1) = 'B'

To find hands where you fold the flop as second action regardless of what was your first one, you check like this:
substring(lookup_actions_f.action from 2 for 1) = 'F'
Here you are checking whether the second character of the action string ("from 2") is 'F', and because you are only checking one character ("for 1") the string you compare it to ('F') must only be one character long.
If lookup_actions_f.action is any of these strings, the above will be true.
'BF'
'CF'
'XF'

By the way: In the FAQ you give us a link to sql to investigate further the meaning of this substring expressions. Honestly, this document is to much for even a very interested but only ordinary skilled PT3 user like me. It would be really nice, if you could give us some day a small, easyily understandable FAQ about how to use the most useful substring expressions (LIKE, % ... and so on )

These functions are standard postgres/SQL functions, and that is the official documentation.
You will find a brief explanation in my custom stats and reports FAQ but I intend to expand this a bit when I have some time.

As a further example:
substring(lookup_actions_f.action from 1 for 1) = 'B'
.. would mean PT3 is looking for hands where I bet the Flop as first action regardless of what happened after?

is equivalent to:
Code: Select all
lookup_actions_f.action LIKE 'B%
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Next

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

Who is online

Users browsing this forum: No registered users and 0 guests