diff --git a/skore/src/skore/sklearn/_estimator/feature_importance_accessor.py b/skore/src/skore/sklearn/_estimator/feature_importance_accessor.py index f3ec08b3a..8fcb34f06 100644 --- a/skore/src/skore/sklearn/_estimator/feature_importance_accessor.py +++ b/skore/src/skore/sklearn/_estimator/feature_importance_accessor.py @@ -233,6 +233,8 @@ def _feature_permutation( if callable(scoring) or isinstance(scoring, (list, dict)): cache_key_parts.append(joblib.hash(scoring)) + else: + cache_key_parts.append(scoring) # order arguments by key to ensure cache works # n_jobs variable should not be in the cache