Skip to main content

Combinatorial Purged Cross-Validation with Embargo for Time Series Data

CPCV with Embargo prevents leakage in time series cross-validation by purging overlapping periods and applying an embargo around test folds.

Installation

pip install git+https://github.com/yosri-bh/cpcv-train-test-data-split-module.git

or

pip install cpcv

Usage

import pandas as pd
from cpcv import CPCV

df = pd.DataFrame({'feature': range(100)})
cpcv = CPCV(n_folds=5, test_size=1, embargo_pct=0.1)
splits = cpcv.split(df)

for train, test in splits:
    print(train.shape, test.shape)

Connect with Me

Thank you for visiting my GitHub profile! Feel free to reach out if you have any questions or opportunities to collaborate. Let's connect and explore new possibilities together:

GitHub LinkedIn Facebook Instagram Email Personal Web Page Google Drive PyPI

Metadata

Release files for cpcv 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cpcv 0.1.0
File Size Uploaded
cpcv-0.1.0.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cpcv 0.1.0
File Interpreter ABI Platform
cpcv-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.2 kB

Release files / cpcv-0.1.0.tar.gz

Download URL cpcv-0.1.0.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
87c8a138f0ddc5622c54ffdd3d93028afd878aaf63f646283f34caf75bf35441
BLAKE2b-256 checksum
How to use checksums
81a1acb9bd133b5ce6f1febc5dd4bd829161dfdd54fae17ac94d3b0388fa5aba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.4

Release files / cpcv-0.1.0-py3-none-any.whl

Download URL cpcv-0.1.0-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1100946e124d64e74f44fcf69ba501b7490c59d119cdb9616bf9f657c32a4bf7
BLAKE2b-256 checksum
How to use checksums
5b4d9e187d803225cd0b68d265bd8723d4741dbaac7ae18220d95f675a11b086
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.4

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page