--- license: cc-by-4.0 task_categories: - time-series-forecasting - tabular-regression - text-generation - question-answering language: - en size_categories: - 1M **Note on `data/fundamentals/`**: Raw per-ticker fundamentals CSVs (~12,000 files: `{TICKER}_balance.csv`, `{TICKER}_income.csv`, `{TICKER}_cashflow.csv`) are **not shipped directly** here because HF enforces a hard cap of 10,000 files per directory. They are reproducible end-to-end via the released pipeline: > > ```bash > python code/collect_fundamentals.py > ``` > > The aggregated/processed versions used by the benchmark API (e.g. `valuation_inputs.parquet`, `private_valuation_inputs.parquet`, `generation_inputs.parquet`) are shipped directly under `data/daily/`, `data/weekly/`, `data/monthly/`, and `data/real_estate/`. ## Data sources & access requirements **What's bundled in this HF release** (no user credentials required): | Source | Bundled artifact | License | |---|---|---| | SEC EDGAR | `filings/` (295k docs), `xbrl/` (46.8M facts) | Public domain (US gov) | | FRED | 46 macroeconomic series | Public domain | | EIA | 7 commodity series | Public domain | | yfinance | `prices/` (OHLCV), `fundamentals/` (quarterly) — derived features | Non-commercial (yfinance ToU) | | RentCast | `real_estate/` (address-level derived features only — rent + price targets, property attributes) | RentCast ToU — derived only | | Macroeconomic events | `scenarios.parquet` (1,130 events × 49 types) | Curated by us, CC-BY-4.0 | **What's NOT bundled** (gated — user credentials required for raw re-fetch via `collect_*.py`): | Source | Status | User-side requirement | |---|---|---| | **Financial-news provider** | **Excluded** — provider ToU prohibits redistribution. The release ships derived counts (`filing_8k_count_30d`, `news_count_7d`, `has_press_release_7d`) only. | **User's own news-API key required** for `collect_news.py` | | **RentCast raw listings** | **Excluded raw** — proprietary. Derived features bundled. | **User's own RentCast subscription** required for `collect_real_estate.py` raw mode | ## Universe The 4,416-ticker universe combines: full Russell 2000 (1,923 IWM holdings), full S&P SmallCap 600 (72 IJR-only additions), iShares Micro-Cap (225 IWC additions), and 2,196 small-cap NASDAQ/NYSE tickers outside all three indices. The split is **3,857 operating companies + 333 funds + 226 SPACs**, with `security_type` recorded for applicability-aware stratification. ## Splits - **Forecasting (T1, T4)**: chronological 70/30 split at **2024-09-03**. - **Valuation + generation (T2, T3, T5, T6)**: **30% company-level holdout = 1,324 tickers** (seed = 42), each contributing its latest valid snapshot. - **Real-estate (T7)**: 30% address-level holdout (random, seeded), with per-property time-axis features. Cluster-bootstrap 95% CIs are computed per task: by `ticker` (T1/T2/T3/T5/T6), `scenario_id` (T4), or `address` (T7). Number of bootstrap resamples is adaptive in [1k, 10k] until `(ci_hi - ci_lo) / |mean| < 0.05`. ## Methods (panel) The release ships a 18-method baseline panel across 7 families: 4 naive, 2 classical, 3 deep sequence, 3 zero-shot TSFM, 2 LLM-adapted multi-task systems, 3 zero-shot frontier LLMs (gpt-oss-120b, gpt-5.1, gemini-3-flash + qwen35). Every method registers via `@register(name=…, family=…, tasks=…)` and exposes the sklearn-style `(fit, predict, save, load)` contract. ```python ml.list_methods() # all registered methods ml.list_methods(task="T1") # methods that support T1 ml.list_methods(family="naive") # naive baselines ``` ## License - **Data**: CC-BY-4.0 (derived features + curated panel) - **Code**: MIT (`code/macrolens/`, `code/dataloader/`, `code/methods/`, `code/eval.py`, `code/experiments/`) - **Vendored libraries** (under `code/methods/_vendored/`): - `tslib/` — MIT (DLinear, iTransformer source) - `moderntcn/` — Apache 2.0 (ModernTCN source) - **Reconstruction scripts** (`collect_*.py`) provided for sources with redistribution restrictions: SEC filings (re-fetch from EDGAR), financial news (re-fetch from provider), real-estate (re-fetch from RentCast). ## Citation ```bibtex @inproceedings{macrolens2026, title = {{MacroLens}: A Multi-Task Benchmark for Contextual Financial Reasoning under Macroeconomic Scenarios}, author = {}, booktitle = {}, year = {2026} } ``` ## Reproducibility When `code/experiments/run_all.py` is executed, each method run produces a `RunRecord` JSON under `code/experiments/results/` recording: `git_sha`, `lib_versions`, `hardware`, `artifact_sha256` (SHA-256 of every parquet read), `timestamp`, and `deterministic_mode`. Predictions are also persisted at `code/experiments/predictions/__seed.pkl` so eval logic can be re-applied via `code/experiments/re_evaluate.py` without re-running the models. These output directories are not shipped on Hugging Face — reviewers reproduce them by running the released code. ## Reconstruction (raw filings + news) The release ships derived features and reconstruction scripts; raw artifacts subject to redistribution restrictions remain re-fetchable: ```bash python collect_universe.py # iShares ETF holdings + NASDAQ Trader directory python collect_filings.py # SEC EDGAR (10-K, 10-Q, 8-K, 20-F, 6-K, N-CSR, N-CSRS) python collect_fundamentals.py # XBRL company facts via SEC EDGAR python collect_prices.py # yfinance OHLCV + adjusted close python collect_news.py # provider-specific (~215k articles) python collect_real_estate.py # RentCast (100 metros, 139,855 properties) python collect_macro.py # FRED + EIA series python preprocess.py python assemble_benchmark.py python generate_scenarios.py python enrich_benchmark.py python build_valuation_tasks.py python validate_all.py ``` ## Authors / Contact Anonymous. Contact at `` after author notification.