← ClaudeAtlas

lib-riskfoliolisted

The 26-risk-measure portfolio optimizer whose stateful API optimizes against stale or missing mu and Sigma - with no error - if you forget assets_stats(). TRIGGER - riskfolio, Riskfolio-Lib, "import riskfolio as rp", rp.Portfolio, rp.HCPortfolio, assets_stats, port.optimization, hcp.optimization, model="HRP"/"HERC"/"NCO", rm="CVaR"/"CDaR"/"EVaR"/"RLVaR"/"EDaR"/"RLDaR", denoiseCov, riskfolio.src.AuxFunctions, ParamsEstimation, entropy_pooling, OWA, MVSK, "solver did not converge". Memory is stale - it is at 7.3.0 (2026-05-31) with an unusual 18 open issues against 4,480 stars. SKIP for GridSearchCV over portfolio models (lib-skfolio) and for whole-share allocation (lib-pyportfolioopt). SKIP when the question is WHICH library to choose, or names no library at all - both belong to the domain skill.
howard-lynn-ye/fin-skills · ★ 1 · AI & Automation · score 77
Install: claude install-skill howard-lynn-ye/fin-skills
# Riskfolio-Lib The most feature-complete open-source portfolio optimizer in Python. Its moat is **26 convex risk measures**, so you can run HRP, HERC, NCO or risk parity under CVaR, CDaR, EVaR or Ulcer instead of variance. | | | |---|---| | pip / import | `Riskfolio-Lib` / **`riskfolio`** (conventionally `import riskfolio as rp`) | | Version | **7.3.0** (2026-05-31) · Python `>=3.10` | | Licence | **BSD-3-Clause** | | Status | ✅ **actively developed and unusually well-tended** — `dcajasn/Riskfolio-Lib`, 4,480★ / **18 open issues** (an outlier in this ecosystem), pushed 2026-08-18 | ## The trap that costs you money 🚨 **The API is imperative and stateful, not sklearn-like.** You must call `port.assets_stats(...)` **before** `port.optimization(...)`, and **re-call it after changing the data**. Skipping it, or mutating `port.returns` afterwards, optimizes against stale or missing μ and Σ rather than raising. The weights come back looking normal. It also does **not** compose with `sklearn.Pipeline` or `GridSearchCV`. If you need cross-validated hyperparameter search over portfolio models, that is `lib-skfolio`. ## Returns, not prices 🚨 `rp.Portfolio(returns=...)` and `rp.HCPortfolio(returns=...)` take **RETURNS**. A price DataFrame runs silently and yields a garbage covariance and garbage weights — the same failure mode as PyPortfolioOpt's `HRPOpt`. Check for negative values before you pass. ⚠️ **pip name ≠ import name:** `pip install Riskfolio-Lib`, then `import riskfo