"""Generate the synthetic example dataset. Every number is invented for this guide."""
import csv
import numpy as np

rng = np.random.default_rng(7)
steps = [0, 500, 1000, 2000, 4000, 8000, 16000]
# Invented saturating curves: (floor, ceiling, rate)
curves = {"Baseline": (0.10, 0.71, 3500), "Example method": (0.10, 0.78, 3000)}

with open("synthetic_accuracy.csv", "w", newline="") as f:
    w = csv.writer(f)
    w.writerow(["method", "seed", "step", "val_accuracy_pct"])
    for method, (lo, hi, k) in curves.items():
        for seed in range(3):
            for s in steps:
                acc = lo + (hi - lo) * (1 - np.exp(-s / k)) + rng.normal(0, 0.015)
                w.writerow([method, seed, s, round(100 * float(np.clip(acc, 0, 1)), 2)])
