`model_selection.split_data_train_validation_test`: Test set starts one point too early
Maintainers usually reply within 2 days
@egordm is already working on this.
Since Dec 16, 2025.
Assessment
This issue has not been assessed yet.
Description
When calling model_selection.split_data_train_validation_test() in backtest mode, the test set starts one point too early. Assume you have a DataFrame of size 100, and test_fraction is 0.1.
Then start_date_test = end_date - np.round(number_indices * test_fraction) * delta (line 176) implies that the test set starts 10 time steps earlier than the last timestamp. So, because we have 100 timestamps in this simple example, the test set starts from timestamp 90. Due to this off-by-one-error, the actual test set size is 11, instead of the expected 10.
A simple fix would be to change line 176 in model_selection/model_selection.py to
start_date_test = end_date - (np.round(number_indices * test_fraction) - 1) * delta
- Dominant language
- Python
- Stars
- 169
- Forks
- 59
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 8
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenSTEF/openstef
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 2 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 2 days
-
Add support for LightGBM importance_type hyperparameterPossibly taken @divya234-hue claimed this 20 days ago. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days
-
chore github-actions
Difficulty 3/5 1-2 days Newbie friendliness 67/100
Maintainers usually reply within 2 days
-
Add RMSEPossibly taken @SANJANAKUMARI83 claimed this 1 day ago. Openenhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 57/100
Maintainers usually reply within 2 days
All issues in OpenSTEF/openstef
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
software-mansion-labs/Diplomat#20 ·
Maintainers usually reply within 1 day
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaPossibly taken @lijy91 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
libnativeapi/nativeapi#53 · 1 reaction ·
Maintainers usually reply within 1 day
-
View Counts discarded due to field name mismatchPossibly taken @rsiva0400 claimed this today. Opensite-bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Model version publishes the new UK firm entity as a personPossibly taken @vahid-ahmadi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PolicyEngine/policyengine.py#764 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
spcl/HPCAgent-Bench#264 ·
Maintainers usually reply within 1 day