diff --git a/sklearn2pmml/ensemble/__init__.py b/sklearn2pmml/ensemble/__init__.py index 9472d09..6c073ea 100644 --- a/sklearn2pmml/ensemble/__init__.py +++ b/sklearn2pmml/ensemble/__init__.py @@ -342,7 +342,7 @@ def _eval_step_mask(self, X, predicate): def fit(self, X, y, **fit_params): X_eval = self._to_evaluation_dataset(X) - mask = numpy.zeros(X.shape[0], dtype = bool) + mask = numpy.full(X.shape[0], fill_value = False) for name, estimator, predicate in self.steps: step_mask = self._eval_step_mask(X_eval, predicate) step_mask[mask] = False @@ -358,7 +358,7 @@ def fit(self, X, y, **fit_params): def _predict(self, X, predict_method): result = None X_eval = self._to_evaluation_dataset(X) - mask = numpy.zeros(X.shape[0], dtype = bool) + mask = numpy.full(X.shape[0], fill_value = False) for name, estimator, predicate in self.steps: step_mask = self._eval_step_mask(X_eval, predicate) step_mask[mask] = False diff --git a/sklearn2pmml/preprocessing/__init__.py b/sklearn2pmml/preprocessing/__init__.py index b7369cc..d2094e2 100644 --- a/sklearn2pmml/preprocessing/__init__.py +++ b/sklearn2pmml/preprocessing/__init__.py @@ -657,7 +657,7 @@ def _eval_step_mask(self, X, predicate): def fit(self, X, y = None): X_eval = self._to_evaluation_dataset(X) - mask = numpy.zeros(X.shape[0], dtype = bool) + mask = numpy.full(X.shape[0], fill_value = False) for name, transformer, predicate in self.steps: step_mask = numpy.logical_not(mask) step_mask_eval = self._eval_step_mask(X_eval[step_mask], predicate) @@ -673,7 +673,7 @@ def fit(self, X, y = None): def transform(self, X): result = None X_eval = self._to_evaluation_dataset(X) - mask = numpy.zeros(X.shape[0], dtype = bool) + mask = numpy.full(X.shape[0], fill_value = False) for name, transformer, predicate in self.steps: step_mask = numpy.logical_not(mask) step_mask_eval = self._eval_step_mask(X_eval[step_mask], predicate)