sklearn TimeSeriesSplit with gap: Walk-Forward Cross-Validation That Does Not Leak the Future
If you cross-validate a forecasting model with KFold(shuffle=True) , the score you get is usually too good to be true. Rows from next month end up in the training set, rows from last month end up in the test set, and the model gets to interpolate instead of forecast. scikit-learn's TimeSeriesSplit…
Read the full story at DEV Community — Machine Learning ↗
Timeline · 1 report
- 2026-11-17 06:26 · DEV Community — Machine Learning
sklearn TimeSeriesSplit with gap: Walk-Forward Cross-Validation That Does Not Leak the Future