Open Family Office Datasets Tickers Strategies Portfolios Research Posts About Changelog

skfolio: Portfolio Optimization in Python

Source

Citation. The library: Hugo Delatte, Carlo Nicolini and Matteo Manzi. skfolio, release v1.15.2, 27 November 2026. Zenodo concept DOI 10.5281/zenodo.16148630. Site: skfolio.org. Source: github.com/skfolio/skfolio, BSD 3-clause licence. The paper: Carlo Nicolini, Matteo Manzi and Hugo Delatte. "skfolio: Portfolio Optimization in Python". Proceedings of the International Research and Industry Symposium on AI (IRIS-AI 25), 2025, pp. 35–41. DOI 10.65236/iris-ai/proceedings/2025/article/3. The README states that "skfolio is backed by Skfolio Labs, which provides enterprise support and SLAs for institutions". The README states no funding. It needs NumPy, SciPy, pandas, cvxpy, Clarabel, scikit-learn and Plotly.

Status. Planned. #332 adds the inverse-volatility benchmark that skfolio offers as a naive model. The project doesn't depend on skfolio. Whether it should, even only to cross-check, is a question for the maintainer below.

Read. Read on 2026-11-28 through a web-fetch subagent. It read these pages from their own text:

The index (llms.txt) and the Portfolio page came back in full for their first part and only as a summary after that. The paper was not read: its page returned no text. So nothing below comes from the paper. The user guide's full CVaR and CDaR formulas were not read.

Summary

Claim. The README presents skfolio as a library for portfolio optimisation and risk management, built on scikit-learn's interface. Each model has fit, and model selection uses scikit-learn's cross-validation and searches.

Method. A library. The parts that a backtest's evaluation touches:

Findings, as the source reports them. These are the defaults that matter for a backtest.

Setting Number Value
WalkForward purge, and embargo 0 observations, and none
CombinatorialPurgedCV folds, test folds, splits, paths 10, 8, 45, 36
The same purge, and embargo 0 and 0 observations
The Sortino ratio and semi-variance default minimum acceptable return the mean of the returns
CVaR default beta 0.95
The deflated Sharpe ratio its count of trials every trial with a Sharpe ratio
Portfolio default annualisation factor 252

Where the claims go beyond the evidence

The purge is a count, not a label's horizon. The docstring of CombinatorialPurgedCV describes López de Prado's purge of training labels "whose labels overlapped in time". The code drops a fixed number of rows instead. The two agree only when every label spans the same number of observations, and the user sets that number.

The defaults leak. Both splitters default to no purge and no embargo. The documentation itself warns that with no purge the results "may be too optimistic" when trades execute with a delay. A user who keeps the defaults has López de Prado's splits without the protection that defines them.

Its Sortino ratio isn't the usual one. The default target is the sample mean, so the denominator is a downside deviation around the mean, not below zero or a fixed target. A Sortino ratio from skfolio and one from another tool can differ for the same returns.

Its deflated Sharpe ratio treats every trial as independent. The documentation warns that correlated trials "may therefore lead to an overly conservative adjustment". The function has no way to pass a smaller, effective count, although expected_max_sharpe_ratio takes one.

No measure has an error. The ratios and tail measures are point estimates. Model selection compares them across folds, with no interval and no test.

The paper is unread. This page couldn't check the paper's claims or tests against the library.

Credit. The documentation states the leak of a zero purge, and the conservatism of its trial count. It cites López de Prado (2018) for the splitters and Bailey and López de Prado (2014) for the deflated Sharpe ratio. It cites Palomar's book for the randomised CV. Its costs and fees enter both the optimiser and the reported returns.

Use in this repo

The splitters: keep the project's own. splits.py (#10) has walk_forward, purged_kfold and cpcv. Each requires purge, the label horizon h in observations, and the k-fold splitters also require embargo. There is no default, so a run must state both, and the trial ledger (#7) records them. That is skfolio's fixed count, made explicit. skfolio's splitters add nothing that the project lacks, and their defaults of zero are the leak that #10 exists to stop.

The measures differ from the project's, on purpose.

The trial count: the project's is better informed. metrics.dsr takes the number of trials from Ledger.count (#7) and the variance of their Sharpe ratios. skfolio counts the trial Sharpe ratios that the caller passes. So it misses any trial that the caller didn't record. The calibration found the opposite risk to skfolio's warning (#325). Effective counts that were too small made the deflated Sharpe ratio too lax, not too strict. So the project counts every trial, and independence.dsr_trials gives a smaller N only from the active returns.

PBO stays in the project. skfolio has no PBO. overfitting.pbo (#11) computes it from the trials' returns.

Costs: the project's model is finer. skfolio charges a linear cost per unit of turnover, spread over the holding period. costs.py (#9) charges each venue's own fee schedule per trade, such as IBKR's fixed fee with its minimum and Kalshi's fee, which depends on the price. A linear cost is fine in an optimiser, but the backtest's returns should keep the venue's real fees.

#332: an inverse-volatility benchmark. The harness compares a run with buy-and-hold and 1/N (harness.py). DeMiguel et al. (2009, optimal-versus-naive-diversification.md) find that naive rules are hard to beat out of sample. skfolio's naive models add inverse volatility. #332 adds it as a benchmark, with each volatility from a trailing window only.

Stress tests: the scenarios come from the whole sample. A vine copula fitted on the full history gives scenarios from data that a backtest at an earlier date couldn't have had. For the stress report (#219), a fitted scenario must come from data before the test period. #328 asks the same of its regime labels.

A question for the maintainer. skfolio would add cvxpy, Clarabel, scikit-learn and Plotly, beyond the NumPy, SciPy and pandas that yfinance brings. The options:

  1. No dependency. The project keeps its own code, and this page records the differences.
  2. A development dependency, to cross-check cpcv_paths, dsr and cvar against skfolio's in a test, with their settings matched. This is the role that #315 proposes for the arch package.
  3. An optional extra for portfolio optimisation, if a portfolio in registry/portfolios/ needs mean-risk weights or risk budgets.

The first option fits the project as it stands, since no portfolio needs an optimiser yet.