spb/wp11_uqo Public
UQO Working Paper No. 11 — Half a million prices, twenty models: a systematic assessment of hedonic specifications.
TeX 54.7%
Python 45.2%
1# Author: Simon-Pierre Boucher — contact@spboucher.ai2"""Paths and global constants for the WP11 pipeline.34All paths are relative to the repository root; override with ``WP11_ROOT``.5"""6import os7from pathlib import Path89ROOT = Path(os.environ.get("WP11_ROOT", Path(__file__).resolve().parents[2]))1011RAW_PARQUET = ROOT / "data" / "raw" / "transactions_700k_avec_registre_foncier.parquet"12PROCESSED = ROOT / "data" / "processed"13ANALYSIS_PARQUET = PROCESSED / "analysis.parquet"14FIGURES = ROOT / "figures"15RESULTS = ROOT / "results"16REPRODUCED = RESULTS / "reproduced"17TABLES = RESULTS / "tables"1819# ---------------------------------------------------------------- sample20RESIDENTIAL_CUBF = {"1000", "1100", "1211", "1990"}21MATCH_MAX_DIST_M = 50.022MATCH_MIN_SCORE = 150.023PRICE_MIN = 50_00024TRIM = (0.01, 0.99) # price and floor-area tails, within sale year25AGE_MAX = 15026GRID_DEG = 0.01 # ~1.1 km spatial grid cells for high-dim FE27GRID5_DEG = 0.05 # ~5.5 km grid, mid-granularity spatial FE2829# ---------------------------------------------------------------- splits30SEED = 2026080931TEST_SHARE = 0.20 # random holdout32TEMPORAL_CUTOFF = "2025-01-01" # train < cutoff, test >= cutoff3334# Box-Cox profile-likelihood grid35BOXCOX_GRID = [-0.50, -0.25, 0.0, 0.25, 0.50, 0.75, 1.0]3637# Learning-curve training sizes38LEARNING_SIZES = [10_000, 25_000, 50_000, 100_000, 200_000, 400_000]3940# Minimum predicted price when inverting level/Box-Cox models41PRED_FLOOR = 20_000.0424344def ensure_dirs() -> None:45 """Create every output directory the pipeline writes to."""46 for p in (PROCESSED, FIGURES, REPRODUCED, TABLES):47 p.mkdir(parents=True, exist_ok=True)48