Skip to content
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

Provide internal implementation of OptunaSearchCV #265

Merged
merged 6 commits into from
May 16, 2024
Merged

Conversation

fraimondo
Copy link
Contributor

Since the current OptunaSearchCV has an issue with respect of scikit-learn's implementation (optuna/optuna-integration#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.

Copy link

codecov bot commented May 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files

Impacted file tree graph

@@           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 Coverage Δ
docs 100.00% <ø> (ø)
julearn 90.13% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
julearn/model_selection/_optuna_searcher.py 82.50% <100.00%> (ø)

@fraimondo fraimondo requested a review from synchon May 15, 2024 07:39
Copy link

github-actions bot commented May 15, 2024

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

Copy link
Member

@synchon synchon left a comment

Choose a reason for hiding this comment

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

Looks good to me, and it might be worth to exempt this from formatting, linting, testing and code coverage.

@synchon synchon merged commit 186c063 into main May 16, 2024
20 checks passed
@synchon synchon deleted the fix/optunasearchcv branch May 16, 2024 08:22
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.

2 participants