skfolio

Optimize portfolios and manage risk with skfolio's scikit-learn compatible API.

Updated Feb 11, 2026
One-click install
npx skills add https://github.com/SilvioBaratto/claude-agent-skills --skill skfolio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: skfolio
Source: https://github.com/SilvioBaratto/claude-agent-skills/tree/main/.github/skills/skfolio
Command: npx skills add https://github.com/SilvioBaratto/claude-agent-skills --skill skfolio

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Portfolio optimization and risk management across multiple assets using skfolio's optimization models, priors, and preprocessing utilities.

Core Features & Use Cases

  • End-to-end optimization with MeanRisk, HRP, HERC, NestedClustersOptimization (NCO), RiskBudgeting, and StackingOptimization.
  • Flexible priors including BlackLitterman, FactorModel, EntropyPooling, OpinionPooling, and SyntheticData for scenario analysis and robust inference.
  • Comprehensive workflows for data preparation, clustering, pre-selection, model selection (WalkForward, CombinatorialPurgedCV), and hyperparameter tuning.
  • Skfolio exposes a scikit-learn compatible API (fit, predict, get_params) and supports metadata routing for complex pipelines.

Quick Start

Load asset data, prepare returns, fit a MeanRisk optimizer, and generate a portfolio in a single step.

Frequently Asked Questions about skfolio

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build an end-to-end portfolio optimization and risk management workflow?

Portfolio optimization workflows integrate data preparation, pre-selection, and model fitting. You can automate this end-to-end using scikit-learn compatible APIs with MeanRisk, HRP, and clustering models to generate optimized portfolios.

What is the best way to apply BlackLitterman priors for portfolio risk management?

Portfolio risk management with priors uses BlackLitterman, FactorModel, or EntropyPooling to incorporate scenario analysis. Fitting these priors within optimization pipelines enables robust inference and adjusted asset allocation based on subjective views.

Does skfolio support scikit-learn pipelines for model selection and hyperparameter tuning?

Model selection and hyperparameter tuning rely on scikit-learn pipelines. The optimization framework exposes fit, predict, and get_params methods, supporting WalkForward and CombinatorialPurgedCV for robust backtesting and parameter optimization.

Can I use NestedClustersOptimization for large asset universes?

NestedClustersOptimization handles moderate-size asset universes by grouping assets through clustering. Combined with HERC and HRP models, it processes pre-selection workflows to manage risk allocation across multiple assets efficiently.

How do I run backtesting and cross-validation on multiple assets?

Backtesting multiple assets requires WalkForward and CombinatorialPurgedCV cross-validation techniques. These model selection tools evaluate optimization strategy performance over time by splitting data into training and testing sets for robust validation.