Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions skpro/model_selection/_tuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}"
Comment on lines 110 to 114
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

Add a regression test to cover the scoring=None path (issue #1009). Without a test, this bug is likely to reappear since BaseGridSearch._fit relies on scoring.name/get_tag and will crash if scoring is ever left as None again. A minimal test can instantiate GridSearchCV with scoring=None, run fit, and assert that cv_results_ contains the expected CRPS-derived score column (e.g., mean_test_CRPS) and that no AttributeError is raised.

Copilot uses AI. Check for mistakes.

backend = self.backend
Expand Down
Loading