Stuck in stat making process

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

Re: Stuck in stat making process

Postby Gster » Tue Apr 26, 2011 7:25 pm

I just noticed something, is the bolded part of my second column redundant?

2)cnt_postf_fold_face_bet_opp

sum(if[ (holdem_hand_player_statistics.flg_f_saw AND holdem_hand_player_detail.amt_f_bet_facing > 0) OR
(holdem_hand_player_statistics.flg_t_saw AND holdem_hand_player_detail.amt_t_bet_facing > 0) OR
(holdem_hand_player_statistics.flg_r_saw AND holdem_hand_player_detail.amt_r_bet_facing > 0), 1, 0])

does the above equal the following

sum(if[ (holdem_hand_player_detail.amt_f_bet_facing > 0) OR
(holdem_hand_player_detail.amt_t_bet_facing > 0) OR
(holdem_hand_player_detail.amt_r_bet_facing > 0), 1, 0])

Seems pretty evident to me that I would have to have seen the flop/turn/river in order to be facing a bet on the flop/turn/river, right?

Also, does having simpler expressions have other benefits besides not having it be messy.
Like, would a simpler expression demand less cpu to run, thus resulting in less lag/better performance?
Gster
 
Posts: 33
Joined: Mon Aug 04, 2008 1:50 pm

Re: Stuck in stat making process

Postby WhiteRider » Wed Apr 27, 2011 4:47 am

Correct – the amount of bet that you faced will only be greater than zero if you saw the relevant street.

Simpler expressions will be slightly more efficient, although when you are using Boolean (true or false) values the difference is pretty trivial, especially once the column values cached.
WhiteRider
Moderator
 
Posts: 54018
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Stuck in stat making process

Postby Gster » Wed Apr 27, 2011 11:02 pm

Ok, thanks!

I trimmed the needless parts of the expression and made 2 other similar statistics using the same concepts,
I'm going to post all 3 below, please let me know if I did it right and if they match their respective descriptions.


1) Fold Post-flop to bet
Description: The amount of times the player has folded post-flop to a bet over the amount of times the player has had the opportunity to fold post-flop to a bet.
Expression: ( cnt_postf_fold_face_bet / cnt_postf_face_bet_opp )

cnt_postf_fold_face_bet

sum(if[ (lookup_actions_f.action SIMILAR TO ('F|XF') AND holdem_hand_player_detail.amt_f_bet_facing > 0) OR
(lookup_actions_t.action SIMILAR TO ('F|XF') AND holdem_hand_player_detail.amt_t_bet_facing > 0) OR
(lookup_actions_r.action SIMILAR TO ('F|XF') AND holdem_hand_player_detail.amt_r_bet_facing > 0), 1, 0])

cnt_postf_face_bet_opp

sum(if[ (holdem_hand_player_detail.amt_f_bet_facing > 0) OR
(holdem_hand_player_detail.amt_t_bet_facing > 0) OR
(holdem_hand_player_detail.amt_r_bet_facing > 0), 1, 0])


2) Call Post-flop to bet
Description: The amount of times the player has called a bet post-flop over the amount of times the player has had the opportunity to call a bet post-flop.
Expression: ( cnt_postf_call_face_bet / cnt_postf_face_bet_opp )

cnt_postf_call_face_bet

sum(if[ (lookup_actions_f.action SIMILAR TO ('C|XC') AND holdem_hand_player_detail.amt_f_bet_facing > 0) OR
(lookup_actions_t.action SIMILAR TO ('C|XC') AND holdem_hand_player_detail.amt_t_bet_facing > 0) OR
(lookup_actions_r.action SIMILAR TO ('C|XC') AND holdem_hand_player_detail.amt_r_bet_facing > 0), 1, 0])

cnt_postf_face_bet_opp

sum(if[ (holdem_hand_player_detail.amt_f_bet_facing > 0) OR
(holdem_hand_player_detail.amt_t_bet_facing > 0) OR
(holdem_hand_player_detail.amt_r_bet_facing > 0), 1, 0])


3) Raise Post-flop to bet
Description: The amount of times the player has raised a bet post-flop over the amount of times the player has had the opportunity to raise a bet post-flop.
Expression: ( cnt_postf_raise_face_bet / cnt_postf_face_bet_opp )

cnt_postf_raise_face_bet

sum(if[ (lookup_actions_f.action SIMILAR TO ('R|XR') AND holdem_hand_player_detail.amt_f_bet_facing > 0) OR
(lookup_actions_t.action SIMILAR TO ('R|XR') AND holdem_hand_player_detail.amt_t_bet_facing > 0) OR
(lookup_actions_r.action SIMILAR TO ('R|XR') AND holdem_hand_player_detail.amt_r_bet_facing > 0), 1, 0])

cnt_postf_face_bet_opp

sum(if[ (holdem_hand_player_detail.amt_f_bet_facing > 0) OR
(holdem_hand_player_detail.amt_t_bet_facing > 0) OR
(holdem_hand_player_detail.amt_r_bet_facing > 0), 1, 0])
Gster
 
Posts: 33
Joined: Mon Aug 04, 2008 1:50 pm

Re: Stuck in stat making process

Postby WhiteRider » Thu Apr 28, 2011 4:00 am

They're pretty close, but you have a couple of errors all the way through.

SIMILAR TO ('F|XF')
..is not quite right. You need the brackets inside the quotes, like this:

SIMILAR TO '(F|XF)'

The brackets define a "token" within the string, which in this case is ("F" OR "XF").

This is fine for folds, because you can make no other action after folding, but for calling and raising there can be other actions afterwards but the expression:
SIMILAR TO '(C|XC)'
..will only count hands where the action ends after the call.
To count hands where there is further action we need to add the wildcard symbol %, like this:

SIMILAR TO '(C|XC)%'
A
That means "(call or check/call) then any zero or more other actions".
You will need to do the same for raises:
SIMILAR TO '(R|XR)%'
WhiteRider
Moderator
 
Posts: 54018
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Stuck in stat making process

Postby Gster » Thu Apr 28, 2011 5:34 am

Ok, I think I made the changes properly, are these stats now working perfectly?

1) Fold Post-flop to bet
Description: The amount of times the player has folded post-flop to a bet over the amount of times the player has had the opportunity to fold post-flop to a bet.
Expression: ( cnt_postf_fold_face_bet / cnt_postf_face_bet_opp )

cnt_postf_fold_face_bet

sum(if[ (lookup_actions_f.action SIMILAR TO '(F|XF)' AND holdem_hand_player_detail.amt_f_bet_facing > 0) OR
(lookup_actions_t.action SIMILAR TO '(F|XF)' AND holdem_hand_player_detail.amt_t_bet_facing > 0) OR
(lookup_actions_r.action SIMILAR TO '(F|XF)' AND holdem_hand_player_detail.amt_r_bet_facing > 0), 1, 0])

cnt_postf_face_bet_opp

sum(if[ (holdem_hand_player_detail.amt_f_bet_facing > 0) OR
(holdem_hand_player_detail.amt_t_bet_facing > 0) OR
(holdem_hand_player_detail.amt_r_bet_facing > 0), 1, 0])


2) Call Post-flop to bet
Description: The amount of times the player has called a bet post-flop over the amount of times the player has had the opportunity to call a bet post-flop.
Expression: ( cnt_postf_call_face_bet / cnt_postf_face_bet_opp )

cnt_postf_call_face_bet

sum(if[ (lookup_actions_f.action SIMILAR TO '(C|XC)%' AND holdem_hand_player_detail.amt_f_bet_facing > 0) OR
(lookup_actions_t.action SIMILAR TO '(C|XC)%' AND holdem_hand_player_detail.amt_t_bet_facing > 0) OR
(lookup_actions_r.action SIMILAR TO '(C|XC)%' AND holdem_hand_player_detail.amt_r_bet_facing > 0), 1, 0])

cnt_postf_face_bet_opp

sum(if[ (holdem_hand_player_detail.amt_f_bet_facing > 0) OR
(holdem_hand_player_detail.amt_t_bet_facing > 0) OR
(holdem_hand_player_detail.amt_r_bet_facing > 0), 1, 0])


3) Raise Post-flop to bet
Description: The amount of times the player has raised a bet post-flop over the amount of times the player has had the opportunity to raise a bet post-flop.
Expression: ( cnt_postf_raise_face_bet / cnt_postf_face_bet_opp )

cnt_postf_raise_face_bet

sum(if[ (lookup_actions_f.action SIMILAR TO '(R|XR)%' AND holdem_hand_player_detail.amt_f_bet_facing > 0) OR
(lookup_actions_t.action SIMILAR TO '(R|XR)%' AND holdem_hand_player_detail.amt_t_bet_facing > 0) OR
(lookup_actions_r.action SIMILAR TO '(R|XR)%' AND holdem_hand_player_detail.amt_r_bet_facing > 0), 1, 0])

cnt_postf_face_bet_opp

sum(if[ (holdem_hand_player_detail.amt_f_bet_facing > 0) OR
(holdem_hand_player_detail.amt_t_bet_facing > 0) OR
(holdem_hand_player_detail.amt_r_bet_facing > 0), 1, 0])
Gster
 
Posts: 33
Joined: Mon Aug 04, 2008 1:50 pm

Re: Stuck in stat making process

Postby kraada » Thu Apr 28, 2011 8:32 am

That looks good to me.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Stuck in stat making process

Postby Gster » Thu Apr 28, 2011 5:35 pm

Thanks!

Can you check this one too? I didn't think any custom columns were needed for this one.

Does the below match the following description: The amount of times the player bet post-flop over
the amount of times the player had the opportunity to bet post-flop.

( cnt_f_bet + cnt_t_bet + cnt_r_bet ) / (( cnt_f_bet + cnt_f_check ) + ( cnt_t_bet + cnt_t_check ) + ( cnt_r_bet + cnt_r_check ))

Just want to make sure my logic isn't flawed. =)
Gster
 
Posts: 33
Joined: Mon Aug 04, 2008 1:50 pm

Re: Stuck in stat making process

Postby WhiteRider » Fri Apr 29, 2011 4:13 am

Yes, that should be fine, although if you want to see it as a percentage you will need to multiply by 100. There is a built-in stat for this, though, called "Bet Total".
WhiteRider
Moderator
 
Posts: 54018
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Stuck in stat making process

Postby Gster » Fri Apr 29, 2011 6:22 am

Ah OK, thanks!

Is this one OK?

Description: The amount of times the player folded to a 3-Bet preflop after the player made a raise preflop over
the amount of times the player had the opportunity to fold to a 3-Bet preflop after the player made a raise preflop.

(cnt_p_3bet_def_action_fold_after_raise / cnt_p_3bet_def_after_raise_opp)

I have 2 custom columns

1) cnt_p_3bet_def_action_fold_after_raise

sum(if[ (holdem_hand_player_statistics.enum_p_3bet_action='F') AND (holdem_hand_player_statistics.cnt_p_raise >= 1), 1, 0])

2) cnt_p_3bet_def_after_raise_opp

sum(if[ (holdem_hand_player_statistics.flg_p_3bet_def_opp) AND (holdem_hand_player_statistics.cnt_p_raise >= 1), 1, 0])
Gster
 
Posts: 33
Joined: Mon Aug 04, 2008 1:50 pm

Re: Stuck in stat making process

Postby kraada » Fri Apr 29, 2011 8:22 am

You probably want to multiply that value expression by 100 to get a percentage rather than a decimal, but otherwise it looks good.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

PreviousNext

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

Who is online

Users browsing this forum: No registered users and 2 guests

cron