Spaces:
Running
Running
Commit History
-
Refactor backend architecture, add MLOps dashboard, and optimise performance
Backend restructuring: - Split 1560-line analytics.py into focused modules: universe, market_data, technical, risk, ml/classifier, ml/clustering, portfolio_optimizer, portfolio_backtester - Centralised CacheManager singleton (core/cache.py) replacing 6+ scattered local cache dicts across services - Added data repository layer (data/stock_repository.py, macro_repository.py) to consolidate all Supabase I/O - Added custom exception hierarchy (core/errors.py) Performance optimisations: - RF classifier PKL persistence: 500 models train once per day, load from disk on subsequent calls (ml/model_store.py) - ML regression bundle PKL: RF+Ridge+GBM trained once per day per symbol/horizon, inference-only on cache hits - Single-flight lock on analytics report build prevents N concurrent rebuilds - GZip middleware added (85% compression on large responses) - portfolio.py async functions now use asyncio.to_thread() — no longer blocks FastAPI event loop on Supabase calls - portfolio.py…500bec8