8000 The deprecation warning is shown also if None is explicitly specified · scikit-learn/scikit-learn@f9c4ce3 · GitHub
[go: up one dir, main page]

Skip to content

Commit f9c4ce3

Browse files
committed
The deprecation warning is shown also if None is explicitly specified
1 parent 8690fd4 commit f9c4ce3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sklearn/ensemble/_base.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,18 @@ def _validate_estimator(self, default=None):
157157

158158
if self.estimator is not None:
159159
self.estimator_ = self.estimator
160-
elif self.base_estimator not in [None, "deprecated"]:
160+
elif self.base_estimator != "deprecated":
161161
warnings.warn(
162162
(
163163
"`base_estimator` was renamed to `estimator` in version 1.2 and "
164164
"will be removed in 1.4."
165165
),
166166
FutureWarning,
167167
)
168-
self.estimator_ = self.base_estimator
168+
if self.base_estimator is not None:
169+
self.estimator_ = self.base_estimator
170+
else:
171+
self.estimator_ = default
169172
else:
170173
self.estimator_ = default
171174

0 commit comments

Comments
 (0)
0