Files
pokerfreak/lesen/fehlerscan.py
T
2026-11-14 01:22:39 +01:00

45 lines
3.1 KiB
Python

#!/usr/bin/env python3
"""Fehlerscan der eigenen Zuege (Uebungstische -> Micro-Tor): grobe Geldverbrennung in zuege.jsonl.
A Fold, obwohl Check frei war
B Fold mit Preis (Modell-Equity >= Break-even + 0.15)
C Call ohne Preis (Modell-Equity <= Break-even - 0.15), meist der MDF-Boden am River
D River-Check mit Monster (Equity >= 0.85, frei); D2 Fold mit Strasse oder besser
E Bluff-Rate: freie Postflop-Spots mit Luft (Equity < 0.30), gesetzt / gesamt; Wert zum Vergleich
Equity ist die Modell-Equity gegen die geschaetzte Range, nicht die Wahrheit.
python lesen/fehlerscan.py [archiv/lauf/zuege.jsonl] [ab-zeit z.B. 2026-11-13]
"""
import sys
import json, re
PFAD = sys.argv[1] if len(sys.argv) > 1 else 'archiv/lauf/zuege.jsonl'
AB = sys.argv[2] if len(sys.argv) > 2 else ''
z = [x for x in (json.loads(l) for l in open(PFAD, encoding='utf-8') if l.strip()) if x['zeit'] >= AB]
def be(x):
m = re.search(r'break-even ([0-9.]+)', x.get('grund') or '')
return float(m.group(1)) if m else None
def wege(x):
m = re.search(r'\((\d)-way\)', x.get('grund') or '')
return int(m.group(1)) if m else 2
def zeig(t, L, n=8):
print(f'\n== {t}: {len(L)}')
for x in L[:n]:
print(' ', x['zeit'][5:16], x['street'][:2], ' '.join(x['hole']), '|', ' '.join(x['board']), f"pot {x['pot']/x['bb']:.1f}bb call {x['toCall']/x['bb']:.1f}bb", x['aktion'], x.get('klasse'), x.get('equity'), '::', (x.get('grund') or '')[:110])
pf = [x for x in z if x['street'] != 'PREFLOP']
zeig('A Fold obwohl Check frei', [x for x in z if x['aktion'] == 'FOLD' and not x['toCall']])
zeig('B Fold mit Preis (Equity >= Break-even+0.15)', [x for x in pf if x['aktion'] == 'FOLD' and be(x) is not None and x['equity'] is not None and x['equity'] >= be(x) + 0.15])
zeig('C Call ohne Preis (Equity <= Break-even-0.15)', [x for x in pf if x['aktion'] == 'CALL' and be(x) is not None and x['equity'] is not None and x['equity'] <= be(x) - 0.15])
zeig('D River-Check mit Monster (eq>=0.85, frei)', [x for x in pf if x['street'] == 'RIVER' and x['aktion'] == 'CHECK' and not x['toCall'] and (x['equity'] or 0) >= 0.85])
zeig('D2 Fold mit Straight+', [x for x in pf if x['aktion'] == 'FOLD' and x.get('klasse') in ('Straight','Flush','FullHouse','FourOfAKind')])
print('\n== E Bluff: freie Postflop-Spots mit Equity < 0.30 (Setzen moeglich)')
for st in ('FLOP', 'TURN', 'RIVER'):
for w in (2, 3):
L = [x for x in pf if x['street'] == st and not x['toCall'] and (x['equity'] or 0) < 0.30 and (wege(x) == 2 if w == 2 else wege(x) >= 3)]
r = sum(x['aktion'] == 'RAISE' for x in L)
print(f' {st:5} {"HU" if w==2 else "3+":2}: {r:3}/{len(L):3} gesetzt = {100*r/max(len(L),1):4.1f} %')
L = [x for x in pf if not x['toCall'] and (x['equity'] or 0) >= 0.65 and wege(x) == 2]
print(f' Wert zum Vergleich (HU, eq>=0.65, frei): {sum(x["aktion"]=="RAISE" for x in L)}/{len(L)} gesetzt')
print('\n== Gruende der freien HU-Luft-Checks am River (Stichprobe)')
for x in [x for x in pf if x['street']=='RIVER' and not x['toCall'] and (x['equity'] or 0)<0.3 and wege(x)==2][:6]:
print(' ', (x.get('grund') or '')[:160])