Skip to content

Fix tune(tune_on_folds=True) when n_rep differs from the number of treatments - #438

Open
AsadGudzevic94 wants to merge 1 commit into
DoubleML:mainfrom
AsadGudzevic94:fix-tune-on-folds-index
Open

AsadGudzevic94 wants to merge 1 commit into
DoubleML:mainfrom
AsadGudzevic94:fix-tune-on-folds-index

Conversation

@AsadGudzevic94

Copy link
Copy Markdown
Contributor

Description

tuning_res is now a list (one per treatment) of separate lists (one per repetition), indexed tuning_res[i_d][i_rep] as it is allocated.

New test doubleml/tests/test_tune_on_folds.py for (n_rep, n_treat) in (1, 1), (2, 1), (1, 2), (3, 2): the returned results have one entry per treatment and repetition, and their parameters are the ones that were set. It fails on main except for (1, 1).

Reference to Issues or PRs

Fixes #433

PR Checklist

  • The title of the pull request summarizes the changes made.
  • The PR contains a detailed description of all changes and additions.
  • References to related issues or PRs are added.
  • The code passes all (unit) tests.
  • Enhancements or new feature are equipped with unit tests.
  • The changes adhere to the PEP8 standards.

@JanTeichertKluge
JanTeichertKluge self-requested a review November 2, 2026 16:51

@JanTeichertKluge JanTeichertKluge left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for implementing, seems fine!
Best
Jan

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tune(tune_on_folds=True) raises IndexError unless n_rep equals the number of treatments

2 participants