CARD / README.md
jean-jsj's picture
Card: point notebook link at docs/examples
a4fae2c verified
|
Raw
History Blame Contribute Delete
5.87 kB
metadata
license: cc-by-4.0
pretty_name: CARD  Causal Recovery of Demand
language:
  - en
tags:
  - causal-inference
  - demand-estimation
  - econometrics
  - retail
  - synthetic-data
  - benchmark
size_categories:
  - 10M<n<100M
configs:
  - config_name: sample_transactions
    data_files: >-
      dev_mini/complex_log_log_endogenous_seed001/public/transactions_train_public.csv
  - config_name: sample_products
    data_files: dev_mini/complex_log_log_endogenous_seed001/public/products_public.csv
  - config_name: sample_stores
    data_files: dev_mini/complex_log_log_endogenous_seed001/public/stores_public.csv

CARD — Causal Recovery of Demand

Can a model that fits observed demand well still recover causal price response, substitution, and counterfactual outcomes when prices and promotions are endogenous?

CARD pairs synthetic retail scanner panels with marketing-copy product descriptions that carry the true substitution geometry. Demand is simulated from a known data-generating process; in half the cells, promotion depth responds to a hidden demand shock, so estimators that ignore endogeneity fit the observed data well and still get the counterfactuals wrong. True elasticities and counterfactual outcomes are hidden and used only for scoring.

Code, submission format, scoring harness, and example notebooks: https://github.com/jean-jsj/CARD

Quickstart

from huggingface_hub import snapshot_download
import pandas as pd

# ~18 MB starter slice (10 stores); use "dev/..." for the full ~1 GB cell
cell = "complex_log_log_endogenous_seed001"
snapshot_download(repo_id="jean-jsj/CARD", repo_type="dataset",
                  allow_patterns=[f"dev_mini/{cell}/*"], local_dir="benchmark")

train = pd.read_csv(f"benchmark/dev_mini/{cell}/public/transactions_train_public.csv")
products = pd.read_csv(f"benchmark/dev_mini/{cell}/public/products_public.csv")

Then score a first submission in minutes with the GitHub quickstart or the two notebooks (Colab-ready). A column-by-column schema is in the repo's data dictionary.

The 2×2 grid

Axis Values
Demand family log-log demand system / structured random-coefficients discrete choice
Endogeneity off (control) / on (promotion depth responds to a hidden demand shock; cost-based instruments stay valid)

Every cell is the full market — 40 products, 731 stores — and covers 156 weeks: 140 public training weeks plus 16 holdout-context weeks whose prices/promotions are public but whose sales are withheld. The four cells are complex_{log_log,covariance_probit}_{exogenous,endogenous}_seed001 (the complex_ prefix is part of the frozen cell identifiers).

Layout

dev/<cell_slug>/                           # full cells (~1 GB each)
  public/    # everything a model may consume
    transactions_train_public.csv            # product, store, week, units, dollars,
                                             # price, promo_flag, promo_cost, supply_cost_proxy
    transactions_holdout_context_public.csv  # holdout weeks: prices/promos public, sales withheld
    counterfactual_sweep_context_public.csv  # the 16 scored price scenarios
    products_public.csv                      # product_id, product_text, brand_code
    stores_public.csv                        # store_id, market, chain
  hidden/    # DEV SEED ONLY: scoring truth for instant local scoring
    transactions_full_hidden.csv             # full 156-week panel; last 16 weeks = forecasting truth
    elasticity_truth_hidden.csv              # the true J x J elasticity matrix
    counterfactual_sweep_truth_hidden.csv    # the true counterfactual demand changes
  release/
    MANIFEST.json                            # per-file SHA-256
    scoring_params.json                      # scoring config (family, eval window)
    release_notes.md, DATASHEET.md

dev_mini/<cell_slug>/                      # ~18 MB 10-store starter slices (log-log pair)

Data-access rule: models consume public/ files only. hidden/ exists for local scoring on the dev seed, never as model input. Eval seeds (added later) ship public-only; their truth stays with the maintainer.

A reference/ tree holds the four reference models' submission-format predictions (reference/<model>/<cell_slug>/, one directory per corner of the instruments × text grid); their scores and descriptions live in the GitHub repo's submissions/ directory, and the estimator code is in its card_metrics/baselines/ directory. A completed datasheet is at DATASHEET.md.

Notes

  • Markets and brand codes are pseudonymized (M01…, B1…), consistently across cells and seeds.
  • The panels are fully synthetic, calibrated to moments of the IRI academic scanner dataset; no real transactions are included.
  • The generating code is withheld during the evaluation phase, with a SHA-256 commitment to the frozen source published in the GitHub repo (released after the evaluation phase).
  • The benchmark's actual-data arm (validity checks on real data) uses the public Dominick's Finer Foods scanner data (Kilts Center, Chicago Booth), downloaded separately — see the GitHub repo.

License & citation

Data: CC BY 4.0. Authors: Juwon Hong, Minha Hwang, and Venkatesh Shankar. DOI: 10.57967/hf/9681. The associated paper reference will be added upon publication.

@misc{hong2026card,
  author    = {Hong, Juwon and Hwang, Minha and Shankar, Venkatesh},
  title     = {CARD: Causal Recovery of Demand},
  year      = {2026},
  doi       = {10.57967/hf/9681},
  publisher = {Hugging Face},
  url       = {https://huggingface.co/datasets/jean-jsj/CARD}
}