predictor / services /model /config.py
pengpeng9099's picture
Deploy World Cup 2026 Predictor (docker space)
1790bde verified
Raw History Blame Contribute Delete
1.14 kB
"""Shared config & paths for the World Cup 2026 prediction engine."""
from __future__ import annotations
import os
import sys
from pathlib import Path
# Force UTF-8 everywhere (Windows console defaults to GBK and chokes on team
# names like "Côte d'Ivoire" / "Curaçao").
os.environ.setdefault("PYTHONUTF8", "1")
os.environ.setdefault("PYTHONIOENCODING", "utf-8")
for _stream in (sys.stdout, sys.stderr):
try:
_stream.reconfigure(encoding="utf-8") # type: ignore[attr-defined]
except Exception:
pass
ROOT = Path(__file__).resolve().parents[2] # worldcup-predictor/
DATA = ROOT / "data"
RAW = DATA / "raw" / "international_results-master"
PROCESSED = DATA / "processed"
ARTIFACTS = ROOT / "services" / "model" / "artifacts"
DB_PATH = DATA / "worldcup.db"
PROCESSED.mkdir(parents=True, exist_ok=True)
ARTIFACTS.mkdir(parents=True, exist_ok=True)
# Modelling constants
WC_TOURNAMENT = "FIFA World Cup"
WC_2026_FROM = "2026-01-01"
TRAIN_FROM = "2010-01-01" # ~16 years; time-decay further down-weights old games
XI_DEFAULT = 0.0006 # time-decay; tuned by backtest.py (RPS-optimal)
MAX_GOALS = 10