← ClaudeAtlas

lib-skfoliolisted

The sklearn-compatible portfolio estimator library whose CombinatorialPurgedCV breaks sklearn's own split() contract - it yields (train, [test_0, ...]), and normal two-variable unpacking mis-partitions your data without raising. TRIGGER - skfolio, skfolio.optimization, MeanRisk, RiskBudgeting, HierarchicalRiskParity, HierarchicalEqualRiskContribution, NestedClustersOptimization, skfolio.moments, DenoiseCovariance, GerberCovariance, ImpliedCovariance, EmpiricalPrior, EntropyPooling, VineCopula, CombinatorialPurgedCV, WalkForward, purged_size, embargo_size, RiskMeasure. Memory is stale and will break code - 1.0.0 landed 2026-08-23, so every recalled snippet predates the API stability commitment. SKIP for the widest risk-measure menu (lib-riskfolio) and for a strictly sklearn-compliant purged splitter (lib-purgedcv). SKIP for choosing between libraries, or when no library is named - the domain skill's job.
howard-lynn-ye/fin-skills · ★ 1 · AI & Automation · score 77
Install: claude install-skill howard-lynn-ye/fin-skills
# skfolio The only portfolio library that is a real scikit-learn estimator collection — so portfolio *construction itself* can be cross-validated, not just the return forecast feeding it. | | | |---|---| | pip / import | `skfolio` / `skfolio` | | Version | **1.0.3** (2026-08-31) — **1.0.0 landed 2026-08-23** · Python `>=3.10` | | Licence | **BSD-3-Clause** | | Status | ✅ **fastest-moving library in the category** — 2,345★ / 41 issues, pushed 2026-09-03; 0.20.2 → 1.0.3 in 18 days | ⚠️ **Positioning, precisely:** skfolio is scikit-learn-***compatible***, part of the sklearn *ecosystem* — **not** an official sub-project, not `scikit-learn-contrib`-governed. ⚠️ **Pre-1.0 knowledge will break.** 1.0.0 shipped 2026-08-23, so essentially every tutorial, blog post and model-recalled snippet predates the stability commitment. Check any 0.x example first. ## The trap that costs you money 🚨 **`CombinatorialPurgedCV.split()` yields `(train_index, [test_0, test_1, …])`** — a *list* of test folds per split, **not** sklearn's 2-tuple contract. Any loop written the normal way — `for train, test in cv.split(X)` — binds `test` to a list of arrays and then indexes with it. It does not raise. It produces a wrong partition and a wrong score, which is exactly the failure mode purged CV exists to prevent. The correct shape is in the snippet below. ## `purged_size` and `embargo_size` are OBSERVATIONS, not time 🚨 Under time bars that is merely opaque. Under **dollar or volume bars a fixed co