diff --git a/pyod/models/ecod.py b/pyod/models/ecod.py index ef7d00f0d..c4e01eadf 100644 --- a/pyod/models/ecod.py +++ b/pyod/models/ecod.py @@ -138,6 +138,7 @@ def decision_function(self, X): The anomaly score of the input samples. """ # use multi-thread execution + X = check_array(X) if self.n_jobs != 1: return self._decision_function_parallel(X) if hasattr(self, 'X_train'): diff --git a/pyod/models/iforest.py b/pyod/models/iforest.py index f45c69f40..048c4b4c2 100644 --- a/pyod/models/iforest.py +++ b/pyod/models/iforest.py @@ -258,7 +258,7 @@ def decision_function(self, X): """ check_is_fitted(self, ['decision_scores_', 'threshold_', 'labels_']) # invert outlier scores. Outliers comes with higher outlier scores - return invert_order(self.detector_.decision_function(X)) + return invert_order(self.detector_.decision_function(check_array(X))) @property def estimators_(self):