juaml / julearn

Forschungszentrum Jülich Machine Learning Library
https://juaml.github.io/julearn
GNU Affero General Public License v3.0
30 stars 19 forks source link

Provide internal implementation of OptunaSearchCV #265

Closed fraimondo closed 4 months ago

fraimondo commented 4 months ago

Since the current OptunaSearchCV has an issue with respect of scikit-learn's implementation (https://github.com/optuna/optuna-integration/issues/118), this PR includes an internal implementation which is fully compatible with scikit-learn.

Particularly, the fit method uses a different study in each call, thus respecting the scikit-learn convention of learning in each call and overriding any previous fit call. The implementation in the optuna-integration package will continue training. This creates a test-to-train leakage when used with scikit-learn's cross_validate function, which is also used by julearn.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.13%. Comparing base (242982e) to head (4cde6b8).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/juaml/julearn/pull/265/graphs/tree.svg?width=650&height=150&src=pr&token=VT2P05ZJCB&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml)](https://app.codecov.io/gh/juaml/julearn/pull/265?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) ```diff @@ Coverage Diff @@ ## main #265 +/- ## ======================================= Coverage 90.13% 90.13% ======================================= Files 54 54 Lines 2423 2423 Branches 491 491 ======================================= Hits 2184 2184 Misses 157 157 Partials 82 82 ``` | [Flag](https://app.codecov.io/gh/juaml/julearn/pull/265/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | Coverage Δ | | |---|---|---| | [docs](https://app.codecov.io/gh/juaml/julearn/pull/265/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | `100.00% <ø> (ø)` | | | [julearn](https://app.codecov.io/gh/juaml/julearn/pull/265/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | `90.13% <100.00%> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/juaml/julearn/pull/265?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | Coverage Δ | | |---|---|---| | [julearn/model\_selection/\_optuna\_searcher.py](https://app.codecov.io/gh/juaml/julearn/pull/265?src=pr&el=tree&filepath=julearn%2Fmodel_selection%2F_optuna_searcher.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVsZWFybi9tb2RlbF9zZWxlY3Rpb24vX29wdHVuYV9zZWFyY2hlci5weQ==) | `82.50% <100.00%> (ø)` | |
github-actions[bot] commented 4 months ago

PR Preview Action v1.4.7 :---: Preview removed because the pull request was closed. 2024-05-16 08:29 UTC