Leckkarte-Umschnitt 18.11.: Live (mit BETTOR+VORFLOP_BAND) foldet gegen kleine River-Einsaetze Top-Paar/Overpair/Zwei Paar vor allem ueber den Defensiv-Veto. VETO_AB=0.9 auf echten NL2-Spots: Dev +19 788 bb, Holdout +12 287 bb (sicher). Pflichtfaelle bestanden, LBR und Sim-Leiter bitgleich. Schalter aus (BEKANNTE_SCHALTER), nicht live. Bericht messung/grosse_calls/TOR.md, STAND §24. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
58 lines
2.2 KiB
Python
58 lines
2.2 KiB
Python
#!/usr/bin/env python3
|
|
"""Delta EV Arm gegen Bezug je Filter (auswahl.filter_von), 95 %-Bootstrap ueber die Setzer (pid_o).
|
|
|
|
python -I -X utf8 messung/grosse_calls/boot.py <spots.jsonl> <muck-zaehler.json> <bezug.jsonl> <arm.jsonl>... [--boot 1000]
|
|
"""
|
|
import collections
|
|
import json
|
|
import os
|
|
import sys
|
|
|
|
import numpy as np
|
|
|
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
import population as P # noqa: E402
|
|
import auswahl as W # noqa: E402
|
|
|
|
|
|
def main(spots, muck, dateien, boot):
|
|
S = P.laden(spots, P.muck_fein(muck))
|
|
A = []
|
|
for d in dateien:
|
|
A.append({json.loads(z)["id"]: json.loads(z) for z in open(d, encoding="utf-8")})
|
|
namen = [os.path.basename(d).split(".")[0] for d in dateien]
|
|
# je Filter: {setzer: [delta je Arm]}
|
|
T = collections.defaultdict(lambda: collections.defaultdict(lambda: np.zeros(len(dateien) - 1)))
|
|
for i, sp in S.items():
|
|
if not all(i in a for a in A):
|
|
continue
|
|
ev = [sp["w"] * P.ev_aktion(sp, a[i].get("action"), a[i].get("size")) for a in A]
|
|
d = np.array([e - ev[0] for e in ev[1:]])
|
|
for f in W.filter_von(sp) + ["alle"]:
|
|
T[f][sp["pid_o"]] += d
|
|
rng = np.random.default_rng(7)
|
|
print("Bezug %s; Delta in bb (Summe), 95 %%-Intervall ueber Setzer" % namen[0])
|
|
erg = {}
|
|
for f in sorted(T):
|
|
m = np.array(list(T[f].values()))
|
|
s = m.sum(0)
|
|
idx = rng.integers(0, len(m), size=(boot, len(m)))
|
|
b = np.stack([m[j].sum(0) for j in idx])
|
|
lo, hi = np.percentile(b, 2.5, axis=0), np.percentile(b, 97.5, axis=0)
|
|
erg[f] = {n: [round(float(s[k]), 1), round(float(lo[k]), 1), round(float(hi[k]), 1)] for k, n in enumerate(namen[1:])}
|
|
print("%-16s setzer %6d " % (f, len(m)) + " ".join(
|
|
"%s %+8.0f [%+.0f, %+.0f]" % (n, s[k], lo[k], hi[k]) for k, n in enumerate(namen[1:])))
|
|
return erg
|
|
|
|
|
|
if __name__ == "__main__":
|
|
a = sys.argv[1:]
|
|
boot = int(a[a.index("--boot") + 1]) if "--boot" in a else 1000
|
|
if "--boot" in a:
|
|
k = a.index("--boot")
|
|
a = a[:k] + a[k + 2:]
|
|
erg = main(a[0], a[1], a[2:], boot)
|
|
aus = os.environ.get("BOOT_AUS")
|
|
if aus:
|
|
json.dump(erg, open(aus, "w", encoding="utf-8", newline="\n"), indent=1)
|