Need help with some custom positional 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

Need help with some custom positional stats...

Postby orentha » Thu Feb 26, 2009 11:23 pm

OK, I'm trying to use Kraada's Advanced HUD configuration post as a guide, to make my own custom popup with positional stats... and I'm lost

I have a stat that I want to break down into positions: EP, MP, LP, blinds
the stat is limp/Fold PF. The amount of time someone limps pf, then folds to a pfr.
the normal stat I have is this:
Code: Select all
sum( if[holdem_hand_player_statistics.flg_p_limp AND holdem_hand_player_statistics.flg_p_fold, 1, 0] )


Now using his guide as a guide, I went to Configure stats, picked holdem cash player statistics.
then clicked on the column tab and made a new column called cnt_p_limp_fold_ep:
Code: Select all
sum( if[holdem_hand_player_statistics.flg_p_limp AND holdem_hand_player_statistics.flg_p_fold and ((holdem_hand_summary.cnt_players = 4 and holdem_hand_player_statistics.position = 1) or
(holdem_hand_summary.cnt_players = 5 and holdem_hand_player_statistics.position = 2) or
(holdem_hand_summary.cnt_players = 6 and holdem_hand_player_statistics.position = 3) or
(holdem_hand_summary.cnt_players = 7 and holdem_hand_player_statistics.position = 4) or
(holdem_hand_summary.cnt_players = 8 and (holdem_hand_player_statistics.position = 4 or holdem_hand_player_statistics.position = 5)) or
(holdem_hand_summary.cnt_players = 9 and (holdem_hand_player_statistics.position = 5 or holdem_hand_player_statistics.position = 6)) or
(holdem_hand_summary.cnt_players = 10 and (holdem_hand_player_statistics.position = 6 or
holdem_hand_player_statistics.position = 7))), 1, 0] )



now do I need to make a cnt_p_limp_fold_ep_opp column ???

If so, would it look like this:
Code: Select all
sum( if[holdem_hand_player_statistics.flg_p_limp AND holdem_hand_player_statistics.flg_p_face_raise and ((holdem_hand_summary.cnt_players = 4 and holdem_hand_player_statistics.position = 1) or
(holdem_hand_summary.cnt_players = 5 and holdem_hand_player_statistics.position = 2) or
(holdem_hand_summary.cnt_players = 6 and holdem_hand_player_statistics.position = 3) or
(holdem_hand_summary.cnt_players = 7 and holdem_hand_player_statistics.position = 4) or
(holdem_hand_summary.cnt_players = 8 and (holdem_hand_player_statistics.position = 4 or holdem_hand_player_statistics.position = 5)) or
(holdem_hand_summary.cnt_players = 9 and (holdem_hand_player_statistics.position = 5 or holdem_hand_player_statistics.position = 6)) or
(holdem_hand_summary.cnt_players = 10 and (holdem_hand_player_statistics.position = 6 or
holdem_hand_player_statistics.position = 7))), 1, 0] )



now... if that is correct. Then the next step would be to make a stat like this:
Code: Select all
cnt_p_limp_fold_ep / cnt_p_limp_face_raise_ep * 100

or do I not have the _p in there ???
would it be this ??? :
Code: Select all
cnt_limp_fold_ep / cnt_limp_face_raise_ep * 100


also, is there any way around this, it kinda sucks when I make a new column or something, I cannot test out the stat, cause it always tells me I need to update the cache before I can... and updating the cache takes me about 55min every time... such a pain



I'm a little lost and some guidance would be great.
Thanks in advance.
orentha
 
Posts: 29
Joined: Thu Jan 24, 2008 7:39 pm

Re: Need help with some custom positional stats...

Postby kraada » Fri Feb 27, 2009 10:48 am

A couple of things:

You're correct about how to build the limp/fold and limp/fold opportunities columns from what I can see. Good job :)

You don't need to have an opportunity column, but it's probably a good idea. At least, I know I'd rather see the percentage of time that someone folds after limping as a function of how often they were faced.

Look at it this way:

Say you have 1000 hands on someone. To keep math simple, assume it's a 10 handed table and it's always been full and he started by posting his blinds, so we have 100 orbits of data, so 300 hands on him in early position. Say he doesn't limp very much and limped only 10 times, and only 5 of those 10 times he faced a raise, and he folded every time he faced the raise. What stat would you want to see? I'd want to see 5/5 -- every time he faced a raise having limped, he folded. 5/10 (the times he limped) would be misleading as I'd expect him to have folded way less than he actually did. 5/300 would make it seem like he never folds when he's folded every time.

As to the actual building of the stat on the stats tab: what you need to refer to is whatever column names you created. If you called them cnt_p_limpfold_ep and cnt_p_limpfold_opp_ep then use those. If you called it cnt_limpfold_ep and cnt_limpfold_ep, use those. What matters is that your stats are referring to the right columns, not what those columns are called (you could call it cnt_mouse_ep and cnt_keyboard_ep if you really wanted -- but I wouldn't recommend it as it'd be hard later to remember what those meant :)).

When building the stat you want to put the division part in parentheses though:

(cnt_p_limp_fold_ep / cnt_limp_face_raise_ep) * 100

I believe our parser can get confused about order of operations otherwise and end up giving you something very wacky (at least it did once, it's possible that got fixed and I don't remember -- but it doesn't hurt to add the ()s so I do it anyway).
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Need help with some custom positional stats...

Postby orentha » Fri Feb 27, 2009 1:26 pm

ok, it's not working... :x

here's what I'm using:
Code: Select all
(cnt_p_limp_fold_ep / cnt_p_limp_faceraise_ep) * 100


that gives me a valid expression, but the stat never appears in my popup box afer I add it...




the 2 columns I'm using are: (cnt_p_limp_fold_ep)
Code: Select all
sum( if[holdem_hand_player_statistics.flg_p_limp AND holdem_hand_player_statistics.flg_p_fold and ((holdem_hand_summary.cnt_players = 4 and holdem_hand_player_statistics.position = 1) or
(holdem_hand_summary.cnt_players = 5 and holdem_hand_player_statistics.position = 2) or
(holdem_hand_summary.cnt_players = 6 and holdem_hand_player_statistics.position = 3) or
(holdem_hand_summary.cnt_players = 7 and holdem_hand_player_statistics.position = 4) or
(holdem_hand_summary.cnt_players = 8 and (holdem_hand_player_statistics.position = 4 or holdem_hand_player_statistics.position = 5)) or
(holdem_hand_summary.cnt_players = 9 and (holdem_hand_player_statistics.position = 5 or holdem_hand_player_statistics.position = 6)) or
(holdem_hand_summary.cnt_players = 10 and (holdem_hand_player_statistics.position = 6 or
holdem_hand_player_statistics.position = 7))), 1, 0] )


and: (cnt_p_limp_faceraise_ep)

Code: Select all
sum( if[holdem_hand_player_statistics.flg_p_limp AND holdem_hand_player_statistics.flg_p_face_raise and ((holdem_hand_summary.cnt_players = 4 and holdem_hand_player_statistics.position = 1) or
(holdem_hand_summary.cnt_players = 5 and holdem_hand_player_statistics.position = 2) or
(holdem_hand_summary.cnt_players = 6 and holdem_hand_player_statistics.position = 3) or
(holdem_hand_summary.cnt_players = 7 and holdem_hand_player_statistics.position = 4) or
(holdem_hand_summary.cnt_players = 8 and (holdem_hand_player_statistics.position = 4 or holdem_hand_player_statistics.position = 5)) or
(holdem_hand_summary.cnt_players = 9 and (holdem_hand_player_statistics.position = 5 or holdem_hand_player_statistics.position = 6)) or
(holdem_hand_summary.cnt_players = 10 and (holdem_hand_player_statistics.position = 6 or holdem_hand_player_statistics.position = 7))), 1, 0] )





wait... instead of the one above, would I need a column called: cnt_p_limp_faceraise_ep_opp ??
if so, how do I build that one?
orentha
 
Posts: 29
Joined: Thu Jan 24, 2008 7:39 pm

Re: Need help with some custom positional stats...

Postby kraada » Fri Feb 27, 2009 2:56 pm

The _opp in stats generally denotes 'opportunity'. You have an opportunity to limp/fold after you limp and face a raise. You don't need any other columns your current ones are fine.

Have you updated your cache since adding these new columns? If you haven't that could be what's causing the stat to not display; when the cache isn't rebuilt after a new stat is added then the cache isn't used for that stat at all and PT3 needs to generate the stat on the fly for everyone at the table -- and that can take a while.

Try rebuilding your cache and see if that fixes it for you.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Need help with some custom positional stats...

Postby orentha » Fri Feb 27, 2009 3:01 pm

hmmm

I think it's been updated, but I guess I"ll try it again

that cant be any bigger of a pain cause my cache takes 55min to do

and if I want to just test out 1 stat, i have to wait 55min?
I cant wait to finish creating this hud that will have 15+ new stats...
(and I know I can probably jsut make all the new stats at once, but if I do that, i dont really know if I'm making them correctly and like to test them out)

sry. had to rant ;)
orentha
 
Posts: 29
Joined: Thu Jan 24, 2008 7:39 pm

Re: Need help with some custom positional stats...

Postby kraada » Fri Feb 27, 2009 3:13 pm

You could put it on the replayer and wait a bit to see if it shows up (in Beta 25, the Hud stats appear on the replayer) :)
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 1 guest