-
Notifications
You must be signed in to change notification settings - Fork 186
[BUG] fix the RandomizedSearchCV backend API mismatch.
#1015
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |
| import pandas as pd | ||
| from sklearn.model_selection import ParameterGrid, ParameterSampler, check_cv | ||
|
|
||
| from skpro.metrics import CRPS | ||
| from skpro.benchmarking.evaluate import evaluate | ||
| from skpro.regression.base._delegate import _DelegatedProbaRegressor | ||
| from skpro.utils.parallel import parallelize | ||
|
|
@@ -108,6 +109,8 @@ def _fit(self, X, y, C=None): | |
|
|
||
| # scoring = check_scoring(self.scoring, obj=self) | ||
| scoring = self.scoring | ||
| if scoring is None: | ||
| scoring = CRPS() | ||
| scoring_name = f"test_{scoring.name}" | ||
|
|
||
| backend = self.backend | ||
|
|
@@ -660,6 +663,7 @@ def __init__( | |
| verbose=0, | ||
| return_n_best_estimators=1, | ||
| random_state=None, | ||
| backend="loky", | ||
| error_score=np.nan, | ||
| backend_params=None, | ||
|
fkiraly marked this conversation as resolved.
|
||
| ): | ||
|
|
@@ -670,6 +674,7 @@ def __init__( | |
| cv=cv, | ||
| verbose=verbose, | ||
| return_n_best_estimators=return_n_best_estimators, | ||
| backend=backend, | ||
| error_score=error_score, | ||
|
Comment on lines
675
to
678
|
||
| backend_params=backend_params, | ||
| ) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scoringis documented as accepting str/callable, but_fitassumes a metric object with.nameand.get_tag()(used forscoring_nameand ranking). Passing a callable or string will raise at runtime. Consider coercing/validatingself.scoringto a BaseMetric (or raising a clear ValueError if unsupported) so the implementation matches the documented API.