Skip to content

Commit

Permalink
Merge pull request #97 from fkiraly/fix-sklearn-adapter
Browse files Browse the repository at this point in the history
[BUG] fix non-use of `params` in `sklearn` adapter objective function
  • Loading branch information
SimonBlanke authored Oct 30, 2024
2 parents da02018 + d192b55 commit 9fb2c3d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# License: MIT License


from sklearn import clone
from sklearn.model_selection import cross_validate
from sklearn.utils.validation import _num_samples

Expand All @@ -20,8 +21,12 @@ def add_validation(self, scoring, cv):
self.cv = cv

def objective_function(self, params):

estimator = clone(self.estimator)
estimator.set_params(**params)

cv_results = cross_validate(
self.estimator,
estimator,
self.X,
self.y,
cv=self.cv,
Expand Down

0 comments on commit 9fb2c3d

Please sign in to comment.