-
Notifications
You must be signed in to change notification settings - Fork 101
Hyperparameter Tuning using Optuna #368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 20 commits
Commits
Show all changes
129 commits
Select commit
Hold shift + click to select a range
2ece803
add optuna tuning to package
JanTeichertKluge 9b846e3
Merge branch 'main' into j-optuna
JanTeichertKluge cf5cdf4
update optuna impl.
JanTeichertKluge f56c0de
update optuna tuning
JanTeichertKluge 4835629
upd gitignore
JanTeichertKluge fefc21d
Remove examples/ from tracking (now gitignored)
JanTeichertKluge 81b9924
Merge branch 'main' into j-optuna
JanTeichertKluge 0ead5d2
update optuna implementation
JanTeichertKluge 8fec084
add name to studies created in _create_study
JanTeichertKluge d69c70f
update optuna implementation
JanTeichertKluge 9081fd6
update optuna implementation
JanTeichertKluge e97c13d
update optuna implementation
JanTeichertKluge 2eda2c8
update optuna implementation
JanTeichertKluge 3489cf3
update optuna implementation
JanTeichertKluge 9585ba4
update optuna implementation
JanTeichertKluge 8318eee
update optuna implementation
JanTeichertKluge 65a8ebd
update optuna implementation
JanTeichertKluge 9e60a62
update optuna implementation
JanTeichertKluge 906e01b
update optuna implementation, add unit tests
JanTeichertKluge 13a7fd1
adjust PLIV optuna tuning
JanTeichertKluge 0acec3e
update for single set of hyperparams instead of fold-specifics
JanTeichertKluge 21825f8
update tests
JanTeichertKluge 4610ef5
Merge branch 'main' into j-optuna
JanTeichertKluge 826236a
del cache files
JanTeichertKluge fa58939
revert estimation.py since everything optuna related is moved to sep.…
JanTeichertKluge f6287ee
rename `params` to `ml_param_space` in tune_optuna method
JanTeichertKluge 3a28380
update ´cv´ object handling, update for partial tuning
JanTeichertKluge d5c9586
renaming tune_optuna to tune_ml_models
JanTeichertKluge 21164da
change return type of nuisance tuning methods to container objects only
JanTeichertKluge f2c759b
formatting
JanTeichertKluge 4914b4e
change print statements to logging statements in _tune_optuna.py
JanTeichertKluge 70501ec
add depreciation warning for tune method in doubleml.py
JanTeichertKluge 7bf2b1e
add depreciation warning for tune method in doubleml.py
JanTeichertKluge cbe1a8c
add optuna to dev dependencies in pyproject.toml
JanTeichertKluge 0752b18
revert changes in std. tune method
JanTeichertKluge 129f9aa
simplify optuna tuning logic
JanTeichertKluge 3b04016
update docstrings
JanTeichertKluge 0a11bcf
revert changes from first implementation of optuna tuning
JanTeichertKluge c46afcd
formatting
JanTeichertKluge 90de845
formatting, reverting changes from previous implementation.
JanTeichertKluge 20aabd8
add pseudo method to util class in tests
JanTeichertKluge a8940bc
update optuna setting validation
JanTeichertKluge 4e9de2b
fix docstring
JanTeichertKluge 9915be3
add doctest execution to pytest job in CI workflow
SvenKlaassen 9aa36d8
fix tune_ml_models docsting
SvenKlaassen ae19cf0
refactor scoring methods resolution into a separate method
SvenKlaassen fc73db5
refactor optuna settings validation logic
SvenKlaassen d556627
refactor _create_objective function by removing unused learner_name p…
SvenKlaassen ff81970
fix the input for objective; remove learner_label
SvenKlaassen a838bad
remove unnecessary test
SvenKlaassen 7c45a89
simplify set param logic
SvenKlaassen 9d070f0
remove sampler test
SvenKlaassen edecd4e
move optuna dependency to the main dependencies section
SvenKlaassen 8ec446d
update optuna tuning methods to not use n_jobs_cv since optuna has it…
JanTeichertKluge 0528e97
adjsut tests
JanTeichertKluge 4a483e9
update test cases
JanTeichertKluge d0062de
adjust params / learner specific settings / param spaces merging
JanTeichertKluge 4ed93d1
adjust params / learner specific settings / param spaces merging
JanTeichertKluge d490274
fix messages in _resolve_optuna_scoring
JanTeichertKluge 0de85a9
update tests for optuna
JanTeichertKluge 966d306
update DMLOptunaResult import DMLOptunaResult
JanTeichertKluge 7137511
bug fix
JanTeichertKluge 61bd137
adjust naming, differentiate between learner name and params name
JanTeichertKluge ff4c878
fix best_params_ change to best_params
JanTeichertKluge 9445cd3
run pre-commit
JanTeichertKluge f2697c1
fix setting-merge bug in _get_optuna_settings
JanTeichertKluge 477fdb5
fix issue for joining param_spaces
JanTeichertKluge 0e7e7c3
add docstring for class DoubleMLAPOS
JanTeichertKluge e283e85
SKIP docstring test output for model classes, adjust optuna tuning
JanTeichertKluge f4bcef3
fix unit tests to reduce computation time
JanTeichertKluge 84dfa64
SKIP docstring test output for doubleml model
JanTeichertKluge 0913b1b
refactor _get_optuna_settings to simplify learner-specific settings r…
SvenKlaassen 4274f85
validate optuna settings to ensure keys are dictionaries
SvenKlaassen d6aa3a2
skip doctest output for tuning results in DoubleML class
SvenKlaassen 56dc711
add random seed initialization in test_solve_quadratic_inequation for…
SvenKlaassen 40f2262
remove unused import of _dml_tune_optuna in DoubleMLPLIV class
SvenKlaassen 37edf6b
ensure all parameter spaces are returned
SvenKlaassen 303a1bb
add missing newline in DMLOptunaResult docstring
SvenKlaassen 1ab7843
update deprecation notice for tune specify version 0.13.0
SvenKlaassen 448c959
enhance DMLOptunaResult docstring with detailed attributes and examples
SvenKlaassen fe26cdf
simplify unit tests for optuna
JanTeichertKluge 17f8710
Merge branch 'j-optuna' of https://github.com/DoubleML/doubleml-for-p…
JanTeichertKluge 87911b8
update tests for optuna tuning
JanTeichertKluge 7d0864c
first implementation of tune_ml_models for APOS
JanTeichertKluge 5923723
formatting
JanTeichertKluge b114c87
test shared docstring for tune_ml_models method(s)
JanTeichertKluge daa5e25
remove fixed random_state from KFold in resolve_optuna_cv for more fl…
SvenKlaassen 6124ca6
Merge branch 'j-optuna' of https://github.com/DoubleML/doubleml-for-p…
JanTeichertKluge 2c3cc71
add optuna tuning to QTE and DiDMulti
JanTeichertKluge 40d3c3a
add unit tests for wrapper models
JanTeichertKluge 3a7140d
create re-usable docstring for tune_ml_models methods
JanTeichertKluge c03d86c
fix issue for using tuned models from output container
JanTeichertKluge fe9ab58
remove exampole
JanTeichertKluge 97f1c8c
check docstring tests for tune_ml_models methods
JanTeichertKluge d5bb48b
remove double import
JanTeichertKluge ae2f263
adjust preliminary theta estimate for optuna tuning
JanTeichertKluge 2685725
adjust pre-docstring for shared docstring in tune_ml_models
JanTeichertKluge 98a6643
fix partial_z naming
SvenKlaassen 7ae51a4
refactor: replace pseudo_target with cross_val_predict for improved p…
SvenKlaassen 6ca20fa
fix code warning
SvenKlaassen 85595d4
remove unnecessary test
SvenKlaassen 342c83b
remove test for tune_res.predict since estimator is not fitted anymore
JanTeichertKluge 349095b
Merge branch 'j-optuna' of https://github.com/DoubleML/doubleml-for-p…
JanTeichertKluge 205b705
fix typo in tune_ml_model docstring
JanTeichertKluge f885492
reduce trials in docstring for tune_ml_models method
JanTeichertKluge 9dcefcc
fix workflow to check only docstrings and tests marked as ci
JanTeichertKluge 0034969
Merge branch 'main' into j-optuna
SvenKlaassen 042e76c
add _nuisance_tuning_optuna placeholder for DoubleMLLPLR class
SvenKlaassen 731e458
remove usage of `study.set_metric_names` since it causes warnings in …
JanTeichertKluge 896d117
update docstring since we allowing for mixed specifications in parame…
JanTeichertKluge 67e7481
change arg `force_all_finite` to `ensure_all_finite` in check_X_y cal…
JanTeichertKluge 270ac04
change arg `force_all_finite` to `ensure_all_finite` for logistic mod…
JanTeichertKluge 43359d0
add _tune_optuna for lplr
SvenKlaassen 970a0b6
refactor: move Optuna utility functions to a new module for better or…
SvenKlaassen 350c87d
move tuning test into submodules
SvenKlaassen 4b5631d
fix M_hat tuning calculation
SvenKlaassen 7cff553
add pytest.mark.ci to various tuning test cases for continuous integr…
SvenKlaassen 2308750
refactor: update model parameters in tuning test
SvenKlaassen 02c3535
test: add NotImplementedError test for nonignorable score in DoubleMLSSM
SvenKlaassen fd0bf1b
remove check for tune_optuna and nonignorable score in SSM.py
SvenKlaassen e764d95
refactor: update min_samples_leaf and max_leaf_nodes for DecisionTree…
SvenKlaassen 81799fd
update tests for overfitting
SvenKlaassen 4b9d96b
refactor: add min_samples_split and max_depth parameters to DecisionT…
SvenKlaassen 2f8b1c6
fix: increase n_trials from 5 to 10 in basic Optuna settings
SvenKlaassen 56c32bf
update cvar setting to allow more overfitting
SvenKlaassen 29b7fd7
standardize tuning tests
SvenKlaassen ff5455d
update tuning tests: increase n_obs to 500, dgp_type to 4, and set n_…
SvenKlaassen 6ba4c30
formatting
SvenKlaassen 80c731f
update treatment assignment logic in DGP functions: update probabilit…
SvenKlaassen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,3 +31,4 @@ MANIFEST | |
| *.vscode | ||
| .flake8 | ||
| .coverage | ||
| .serena | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /cache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| # language of the project (csharp, python, rust, java, typescript, go, cpp, or ruby) | ||
| # * For C, use cpp | ||
| # * For JavaScript, use typescript | ||
| # Special requirements: | ||
| # * csharp: Requires the presence of a .sln file in the project folder. | ||
| language: python | ||
|
|
||
| # whether to use the project's gitignore file to ignore files | ||
| # Added on 2025-04-07 | ||
| ignore_all_files_in_gitignore: true | ||
| # list of additional paths to ignore | ||
| # same syntax as gitignore, so you can use * and ** | ||
| # Was previously called `ignored_dirs`, please update your config if you are using that. | ||
| # Added (renamed) on 2025-04-07 | ||
| ignored_paths: [] | ||
|
|
||
| # whether the project is in read-only mode | ||
| # If set to true, all editing tools will be disabled and attempts to use them will result in an error | ||
| # Added on 2025-04-18 | ||
| read_only: false | ||
|
|
||
| # list of tool names to exclude. We recommend not excluding any tools, see the readme for more details. | ||
| # Below is the complete list of tools for convenience. | ||
| # To make sure you have the latest list of tools, and to view their descriptions, | ||
| # execute `uv run scripts/print_tool_overview.py`. | ||
| # | ||
| # * `activate_project`: Activates a project by name. | ||
| # * `check_onboarding_performed`: Checks whether project onboarding was already performed. | ||
| # * `create_text_file`: Creates/overwrites a file in the project directory. | ||
| # * `delete_lines`: Deletes a range of lines within a file. | ||
| # * `delete_memory`: Deletes a memory from Serena's project-specific memory store. | ||
| # * `execute_shell_command`: Executes a shell command. | ||
| # * `find_referencing_code_snippets`: Finds code snippets in which the symbol at the given location is referenced. | ||
| # * `find_referencing_symbols`: Finds symbols that reference the symbol at the given location (optionally filtered by type). | ||
| # * `find_symbol`: Performs a global (or local) search for symbols with/containing a given name/substring (optionally filtered by type). | ||
| # * `get_current_config`: Prints the current configuration of the agent, including the active and available projects, tools, contexts, and modes. | ||
| # * `get_symbols_overview`: Gets an overview of the top-level symbols defined in a given file. | ||
| # * `initial_instructions`: Gets the initial instructions for the current project. | ||
| # Should only be used in settings where the system prompt cannot be set, | ||
| # e.g. in clients you have no control over, like Claude Desktop. | ||
| # * `insert_after_symbol`: Inserts content after the end of the definition of a given symbol. | ||
| # * `insert_at_line`: Inserts content at a given line in a file. | ||
| # * `insert_before_symbol`: Inserts content before the beginning of the definition of a given symbol. | ||
| # * `list_dir`: Lists files and directories in the given directory (optionally with recursion). | ||
| # * `list_memories`: Lists memories in Serena's project-specific memory store. | ||
| # * `onboarding`: Performs onboarding (identifying the project structure and essential tasks, e.g. for testing or building). | ||
| # * `prepare_for_new_conversation`: Provides instructions for preparing for a new conversation (in order to continue with the necessary context). | ||
| # * `read_file`: Reads a file within the project directory. | ||
| # * `read_memory`: Reads the memory with the given name from Serena's project-specific memory store. | ||
| # * `remove_project`: Removes a project from the Serena configuration. | ||
| # * `replace_lines`: Replaces a range of lines within a file with new content. | ||
| # * `replace_symbol_body`: Replaces the full definition of a symbol. | ||
| # * `restart_language_server`: Restarts the language server, may be necessary when edits not through Serena happen. | ||
| # * `search_for_pattern`: Performs a search for a pattern in the project. | ||
| # * `summarize_changes`: Provides instructions for summarizing the changes made to the codebase. | ||
| # * `switch_modes`: Activates modes by providing a list of their names | ||
| # * `think_about_collected_information`: Thinking tool for pondering the completeness of collected information. | ||
| # * `think_about_task_adherence`: Thinking tool for determining whether the agent is still on track with the current task. | ||
| # * `think_about_whether_you_are_done`: Thinking tool for determining whether the task is truly completed. | ||
| # * `write_memory`: Writes a named memory (for future reference) to Serena's project-specific memory store. | ||
| excluded_tools: [] | ||
|
|
||
| # initial prompt for the project. It will always be given to the LLM upon activating the project | ||
| # (contrary to the memories, which are loaded on demand). | ||
| initial_prompt: "" | ||
|
|
||
| project_name: "doubleml-for-py" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.