CPCV with Embargo prevents leakage in time series cross-validation by purging overlapping periods and applying an embargo around test folds.
pip install git+https://github.com/yosri-bh/cpcv-train-test-data-split-module.gitor
pip install cpcvimport 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)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: