8000 MAINT Apply ruff/Perflint rule PERF403 · scikit-learn/scikit-learn@e25d49c · GitHub
[go: up one dir, main page]

Skip to content

Commit e25d49c

Browse files
MAINT Apply ruff/Perflint rule PERF403
PERF403 Use a dictionary comprehension instead of a for-loop
1 parent 541d506 commit e25d49c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sklearn/model_selection/_search.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,8 +1139,12 @@ def _store(key_name, array, weights=None, splits=False, rank=False):
11391139
_store("fit_time", out["fit_time"])
11401140
_store("score_time", out["score_time"])
11411141
# Store a list of param dicts at the key 'params'
1142-
for param, ma in _yield_masked_array_for_each_param(candidate_params):
1143-
results[param] = ma
1142+
results.update(
1143+
{
1144+
param: ma
1145+
for param, ma in _yield_masked_array_for_each_param(candidate_params)
1146+
}
1147+
)
11441148
results["params"] = candidate_params
11451149

11461150
test_scores_dict = _normalize_score_results(out["test_scores"])

0 commit comments

Comments
 (0)
0