Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.

Conversation

@kernc
Copy link
Contributor

@kernc kernc commented May 8, 2021

Re-add BayesSearchCV.best_score_, needed by examples/sklearn-gridsearchcv-replacement.py.

Removed in 9461bfe (#988), which broke CircleCI docs build, which for some reason wasn't caught in PR CI.

Removed in 9461bfe
"Remove BayesSearchCV(iid=) parameter deprecated in sklearn 0.24 (scikit-optimize#988)"
@glouppe glouppe merged commit c539988 into scikit-optimize:master May 8, 2021
@kernc
Copy link
Contributor Author

kernc commented May 8, 2021

@glouppe Notice the CI failing? 😅

I suppose the error is:

>               self.best_score_ = results["mean_test_%s" % refit_metric][self.best_index_]
E               AttributeError: can't set attribute

as sklearn's BaseSearchCV in some cases does assign our required best_score_ attribute, but it obviously can't assign it when it's been made a non-settable property.

As a matter of fact, I don't quite understand why examples/sklearn-gridsearchcv-replacement.py was failing in the first place. The only explanation is that multimetric_ somehow ended up True. I don't think the applied was necessarily a correct or the best fix. 😬

@glouppe
Copy link
Member

glouppe commented May 10, 2021

Woops, sorry :x Shall I revert or can you push a hotfix?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants