From e37376172578789a34f25114464c9d84b6bca7b3 Mon Sep 17 00:00:00 2001 From: ekkoitac Date: Mon, 30 Mar 2026 18:36:34 +0800 Subject: [PATCH] fix: handle scoring=None in GridSearchCV._fit to avoid AttributeError (#1009) When scoring=None is passed to GridSearchCV.fit(), line 111 crashes with AttributeError: 'NoneType' object has no attribute 'name'. Fix: use 'test_CPRS' as scoring_name when scoring is None. --- skpro/model_selection/_tuning.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skpro/model_selection/_tuning.py b/skpro/model_selection/_tuning.py index dbac1b22c..17bb37ec1 100644 --- a/skpro/model_selection/_tuning.py +++ b/skpro/model_selection/_tuning.py @@ -108,7 +108,7 @@ def _fit(self, X, y, C=None): # scoring = check_scoring(self.scoring, obj=self) scoring = self.scoring - scoring_name = f"test_{scoring.name}" + scoring_name = f"test_{scoring.name}" if scoring is not None else "test_CPRS" backend = self.backend backend_params = self.backend_params if self.backend_params else {}