33 lines
1.8 KiB
Python
33 lines
1.8 KiB
Python
"""Replay zweier Kern-Ausgaben auf den 2776 echten Preflop-Spots: welche Aktionen kippen, je Klasse.
|
|
python messung_preflop/replay2.py <aus_basis.jsonl> <aus_arm.jsonl>"""
|
|
import json, collections, sys
|
|
a_path, b_path = sys.argv[1:3]
|
|
aus=[json.loads(l) for l in open(a_path,encoding='utf-8')]
|
|
an=[json.loads(l) for l in open(b_path,encoding='utf-8')]
|
|
rows=[json.loads(l) for l in open('messung_preflop/nachher.jsonl',encoding='utf-8')]
|
|
spots=[json.loads(l) for l in open('messung_preflop/spots.jsonl',encoding='utf-8')]
|
|
netto={}
|
|
for l in open('messung_preflop/haende.jsonl',encoding='utf-8'):
|
|
h=json.loads(l)
|
|
if h.get('bb'): netto[str(h['hand'])]=h['netto']/h['bb']
|
|
def grob(r):
|
|
k=r['klasse'].replace(' [all-in]','')
|
|
if k.startswith('first-in'): k='first-in'+(' '+r.get('pos','') if r.get('pos') else '')
|
|
elif k.startswith('vs open HU-linie'): k=k
|
|
return k+(' >100bb' if (r.get('tiefe') or 0)>100 else '')
|
|
n=collections.Counter(); kipp=collections.Counter(); wege=collections.defaultdict(collections.Counter); bb=collections.defaultdict(float)
|
|
gesamt=0
|
|
for a,b,r,s in zip(aus,an,rows,spots):
|
|
k=grob(r); n[k]+=1
|
|
if a['action']!=b['action']:
|
|
gesamt+=1; kipp[k]+=1; wege[k][f"{a['action']}->{b['action']}"]+=1; bb[k]+=netto.get(str(s['hand']),0)
|
|
print(f"{a_path} -> {b_path}\n\nAktion gekippt: {gesamt}/{len(aus)} = {100*gesamt/len(aus):.1f} %\n")
|
|
print("| Klasse | Spots | gekippt | Richtungen | Live BB der Haende (vorher gespielt) |\n|---|---|---|---|---|")
|
|
for k,c in sorted(kipp.items(),key=lambda kv:-kv[1]):
|
|
w=', '.join(f"{x} {m}" for x,m in wege[k].most_common(4))
|
|
print(f"| {k} | {n[k]} | {c} | {w} | {bb[k]:+.1f} |")
|
|
tot=collections.Counter()
|
|
for k in wege:
|
|
for x,m in wege[k].items(): tot[x]+=m
|
|
print("\nRichtungen gesamt:", dict(tot.most_common()))
|