Production-ready finance library for portfolio construction, risk analytics, quantitative metrics, and ML-based regime detection