Software

RiskLabAI is a pair of open-source libraries — one in Python, one in Julia — that implement advanced methods for quantitative finance and financial machine learning. The two share a consistent public API, so a method learned in one language transfers directly to the other.

PythonStable · on PyPI

The reference implementation: a mature, tested library covering the full method stack, with numba-accelerated hot paths and an extensible component registry.

pip install RiskLabAI
import RiskLabAI
JuliaActively developed

A performance-oriented Julia port that mirrors the Python API, adding an elegant parametric bar-type taxonomy and native support for scientific computing.

pkg> add https://github.com/RiskLabAI/RiskLabAI.jl
using RiskLabAI

What's inside

The libraries implement techniques from Marcos López de Prado's Advances in Financial Machine Learning, Machine Learning for Asset Managers and Causal Factor Investing, alongside original extensions developed at RiskLab.

Financial data science

  • Information-driven bars (tick, volume, dollar, imbalance & run bars)
  • Labeling: triple-barrier, meta-labeling and trend-scanning
  • Sample weights from label uniqueness and concurrency
  • Fractional differentiation (standard & fixed-width FFD)
  • Covariance denoising & detoning (Marčenko–Pastur, NERCOME)

Feature engineering

  • Distance metrics & codependence (KSG mutual information, distance correlation)
  • Optimal clustering (ONC)
  • Feature importance: MDI, MDA, SFI and debiased variants
  • Structural breaks: CUSUM, SADF/GSADF and PELT
  • Entropy and market-microstructure features

Modeling & backtesting

  • Ensemble methods for financial models
  • Purged K-Fold and Combinatorial Purged Cross-Validation
  • Leakage-aware hyper-parameter tuning
  • Backtest statistics, PSR/DSR and Probability of Backtest Overfitting
  • Bet sizing and strategy-risk analysis

Optimization & advanced

  • Hierarchical Risk Parity (HRP)
  • Nested Clustered Optimization (NCO)
  • PCA-based hedging
  • Deep-BSDE solver for financial PDEs
  • High-performance multiprocessing utilities