diff --git a/sklearn/ensemble/bagging.py b/sklearn/ensemble/bagging.py index c2a65d9120e87..4da44bfd0f20d 100644 --- a/sklearn/ensemble/bagging.py +++ b/sklearn/ensemble/bagging.py @@ -298,7 +298,7 @@ def _fit(self, X, y, max_samples, max_depth=None, sample_weight=None): # if max_samples is float: if not isinstance(max_samples, (numbers.Integral, np.integer)): - max_samples = int(self.max_samples * X.shape[0]) + max_samples = int(max_samples * X.shape[0]) if not (0 < max_samples <= X.shape[0]): raise ValueError("max_samples must be in (0, n_samples]")