quant-ml-purged-cv-integration

Integrate CombinatorialPurgedKFold with configurable purge and embargo windows into financial ML pipelines.

14|3|Updated Jan 17, 2026
One-click install
npx skills add https://github.com/kofttlcc/quant-test --skill quant-ml-purged-cv-integration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: quant-ml-purged-cv-integration
Source: https://github.com/kofttlcc/quant-test/tree/main/.agent/skills/community/quant-ml-purged-cv-integration
Command: npx skills add https://github.com/kofttlcc/quant-test --skill quant-ml-purged-cv-integration

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires sklearn, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill prevents data leakage during the training of Machine Learning models on financial time-series data by implementing Purged Cross-Validation (CV).

Core Features & Use Cases

  • Data Leakage Prevention: Ensures that training data never overlaps with validation data in time.
  • Financial Time-Series Focus: Specifically designed for sequential financial data where temporal order is critical.
  • Use Case: When training a stock price prediction model, this Skill ensures that the data used for validation in any given fold has not been seen during the training of that fold, preventing unrealistic performance metrics.

Quick Start

Integrate the CombinatorialPurgedKFold class into your ML model's training pipeline to perform purges before validation splits.

Frequently Asked Questions about quant-ml-purged-cv-integration

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

FAQPage Schema
How do I prevent data leakage when training machine learning models on financial time series?

Purged cross-validation prevents data leakage in financial time series by excluding overlapping future data points from training sets relative to validation sets. It utilizes CombinatorialPurgedKFold with configurable purge and embargo windows to maintain temporal integrity.

How does purged cross-validation work with sklearn for sequential financial data?

Purged cross-validation works with sklearn by applying CombinatorialPurgedKFold to sequential financial data. It actively purges training observations that temporally overlap with validation sets and applies an embargo window to prevent predictive leakage from autocorrelated data.

What is the difference between standard k-fold CV and purged CV for stock price prediction?

Unlike standard k-fold CV, purged CV for stock price prediction enforces temporal ordering by removing data points near the validation set boundaries. This prevents unrealistic performance metrics caused by training on information that would not be available at prediction time.

How do I configure purge and embargo windows for time-series machine learning validation?

You configure time-series validation by setting the purge_window and embargo_window parameters in CombinatorialPurgedKFold. The purge_window removes overlapping training data, while the embargo_window excludes immediately adjacent observations to account for serial correlation in financial data.

When should I use purged cross-validation instead of standard train-test splits?

You should use purged cross-validation instead of standard splits when working with sequential financial time-series data. It is specifically required when temporal order is critical and standard random splitting would cause future data leakage into training sets.

Why does my machine learning model show unrealistic performance metrics on financial time series data?

Unrealistic performance metrics on financial time series often result from data leakage during validation. Your model likely trained on future data points relative to the validation set, which can be fixed by integrating purged cross-validation to exclude overlapping temporal data.