{
 "study": "propensity-versus-uplift",
 "round": "r1",
 "frozen_before": "any model fit or score",
 "looked_at_before_design": {
  "hillstrom_arms": {"Mens E-Mail": {"n": 21307, "purchase_pct": 1.253}, "Womens E-Mail": {"n": 21387, "purchase_pct": 0.884}, "No E-Mail": {"n": 21306, "purchase_pct": 0.573}},
  "criteo_sample_arms": {"treated": {"n": 2970784, "conversion_pct": 0.31}, "control": {"n": 523575, "conversion_pct": 0.19, "conversions": 995}}
 },
 "data": {
  "hillstrom": {"file": "hillstrom.csv", "sha256": "0e5893329d8b93cefecc571777672028290ab69865718020c78c7284f291aece", "rows": 64000,
   "control_arm": "No E-Mail", "primary_arm": "Mens E-Mail", "secondary_arm": "Womens E-Mail", "pooled_arms": false,
   "features": {"numeric": ["recency", "log1p(history)"], "binary": ["mens", "womens", "newbie"], "one_hot": ["zip_code", "channel"]},
   "not_used": ["history_segment (a binned copy of history)"]},
  "criteo": {"file": "criteo-research-uplift-v2.1.csv.gz", "sha256": "2716e1bf0fd157a93b5bf86924d9088419dfbac2022c6cd90030220634f616dc", "rows": 13979592,
   "sample": {"rule": "keep data line i (0-based, header excluded) when int.from_bytes(blake2b(i as 8 little-endian bytes, digest_size=8, key=b'propensity-versus-uplift'), 'little') % 4 == 0", "rows": 3494359},
   "features": {"numeric": ["f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", "f11"]},
   "not_used": ["exposure (measured after treatment)"]}
 },
 "outcomes": {"primary": "conversion", "secondary": "visit", "money": "spend (Hillstrom only)"},
 "folds": {"k": 5, "assignment": "within each arm, numpy default_rng(seed).permutation of that arm's row indices, fold = position % 5", "seed": 20261123,
  "hillstrom_refit_seeds": [1, 2, 3, 4]},
 "models": {
  "logistic": {"sklearn": "LogisticRegression", "C": 1.0, "solver": "lbfgs", "max_iter": 2000, "preprocessing": "numeric standardized on the training folds; binaries and one-hot as 0/1"},
  "gbm": {"sklearn": "HistGradientBoostingClassifier", "learning_rate": 0.05, "max_iter": 200, "max_leaf_nodes": 15,
   "min_samples_leaf": {"hillstrom": 100, "criteo": 1000}, "l2_regularization": 1.0, "early_stopping": false, "random_state": 0},
  "gbm_regressor": {"sklearn": "HistGradientBoostingRegressor", "loss": "squared_error", "same_settings_as": "gbm"},
  "propensity": "P(purchase | no send), fitted on the no-send arm of the training folds",
  "response": "P(purchase | send), fitted on the sent arm of the training folds",
  "uplift_two_model": "response score minus propensity score, same algorithm",
  "uplift_transformed_outcome": "gbm_regressor on Z = Y (T - e) / (e (1 - e)), e = sent share of the pair in the training folds, both arms",
  "baseline_rule_hillstrom": "rank by history (past-year spend) descending, ties by recency ascending",
  "rankings": ["past_spend", "propensity_logistic", "propensity_gbm", "response_logistic", "response_gbm", "uplift2_logistic", "uplift2_gbm", "uplift_to_gbm"],
  "primary_pair": ["propensity_logistic", "uplift2_logistic"]
 },
 "evaluation": {
  "scores": "out of fold only",
  "ties": "broken by a seeded uniform key (numpy default_rng(7))",
  "deciles": "equal-count over both arms of the pair, by score rank, highest first",
  "decile_interval": "95% Newcombe hybrid score interval (method 10) for the difference of two proportions",
  "auc": "no-send arm, out of fold; 95% bootstrap interval",
  "brier": "no-send arm; skill = 1 - Brier / Brier of the training-fold base rate",
  "reliability": "10 equal-count bins of predicted probability, no-send arm",
  "would_have_bought_anyway": "purchase rate not sent / purchase rate sent, within a group",
  "qini": "gain(k) = (rate sent in top k - rate not sent in top k) * (n in top k / N) * 1000, extra purchases per 1,000 customers on the list; k on a 1% grid; top k fixed by the full-data score cut",
  "qini_coefficient": "mean over k = 1%..100% of gain(k) - k * gain(100%)",
  "decision_share": 0.30,
  "main_test": "gain(30%) of uplift2_logistic minus gain(30%) of propensity_logistic, paired 95% bootstrap interval",
  "bootstrap": {"weights": "Poisson(1) per customer", "seed": 7, "resamples": {"hillstrom": 1000, "criteo": 200}, "model_refit": "not resampled; Hillstrom refit with fold seeds 1 to 4 reported separately"}
 },
 "money_hillstrom": {"arm": "Mens E-Mail", "margin_on_spend": {"base": 0.40, "range": [0.25, 0.40, 0.60]},
  "cost_per_send_usd": [0.01, 0.10, 0.25, 0.50, 1.00], "shares": "10% grid", "note": "best share read off the same data, labelled so"},
 "follow_up": "the same models, folds, pair and measures on the Criteo sample; conversion primary, visit beside it",
 "headline": "the primary pair at the top 30% and the would-have-bought-anyway share on Hillstrom; the follow-up in the paragraph under it"
}
