Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check_array added to fit in iforest and ecod #475

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyod/models/ecod.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down
2 changes: 1 addition & 1 deletion pyod/models/iforest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down