Skip to content

Commit 12f3fc7

Browse files
committed
DOC improve _BaseComposition comments
1 parent 2c9c977 commit 12f3fc7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sklearn/utils/metaestimators.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ def _get_params(self, attr, deep=True):
5656

5757
def _set_params(self, attr, **params):
5858
# Ensure strict ordering of parameter setting:
59-
# 1. All steps
59+
# 1. Replace the entire estimators collection
6060
if attr in params:
6161
setattr(self, attr, params.pop(attr))
62-
# 2. Replace items with estimators in params
62+
# 2. Replace individual estimators by name
6363
items = getattr(self, attr)
6464
if isinstance(items, list) and items:
6565
# Get item names used to identify valid names in params
@@ -71,7 +71,7 @@ def _set_params(self, attr, **params):
7171
if "__" not in name and name in item_names:
7272
self._replace_estimator(attr, name, params.pop(name))
7373

74-
# 3. Step parameters and other initialisation arguments
74+
# 3. Individual estimator parameters (using name__param syntax) and other initialisation arguments
7575
super().set_params(**params)
7676
return self
7777

0 commit comments

Comments
 (0)