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:
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)
| File | Size | Uploaded | |
|---|---|---|---|
| cpcv-0.1.0.tar.gz | 6.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|