# Author: Simon-Pierre Boucher — contact@spboucher.ai """Paths and global constants for the WP11 pipeline. All paths are relative to the repository root; override with ``WP11_ROOT``. """ import os from pathlib import Path ROOT = Path(os.environ.get("WP11_ROOT", Path(__file__).resolve().parents[2])) RAW_PARQUET = ROOT / "data" / "raw" / "transactions_700k_avec_registre_foncier.parquet" PROCESSED = ROOT / "data" / "processed" ANALYSIS_PARQUET = PROCESSED / "analysis.parquet" FIGURES = ROOT / "figures" RESULTS = ROOT / "results" REPRODUCED = RESULTS / "reproduced" TABLES = RESULTS / "tables" # ---------------------------------------------------------------- sample RESIDENTIAL_CUBF = {"1000", "1100", "1211", "1990"} MATCH_MAX_DIST_M = 50.0 MATCH_MIN_SCORE = 150.0 PRICE_MIN = 50_000 TRIM = (0.01, 0.99) # price and floor-area tails, within sale year AGE_MAX = 150 GRID_DEG = 0.01 # ~1.1 km spatial grid cells for high-dim FE GRID5_DEG = 0.05 # ~5.5 km grid, mid-granularity spatial FE # ---------------------------------------------------------------- splits SEED = 20260809 TEST_SHARE = 0.20 # random holdout TEMPORAL_CUTOFF = "2025-01-01" # train < cutoff, test >= cutoff # Box-Cox profile-likelihood grid BOXCOX_GRID = [-0.50, -0.25, 0.0, 0.25, 0.50, 0.75, 1.0] # Learning-curve training sizes LEARNING_SIZES = [10_000, 25_000, 50_000, 100_000, 200_000, 400_000] # Minimum predicted price when inverting level/Box-Cox models PRED_FLOOR = 20_000.0 def ensure_dirs() -> None: """Create every output directory the pipeline writes to.""" for p in (PROCESSED, FIGURES, REPRODUCED, TABLES): p.mkdir(parents=True, exist_ok=True)