Skip to content
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
2 changes: 1 addition & 1 deletion docs/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Adam Goodge (PhD Researcher @ National University of Singapore):
- Joined in 2022 (implemented LUNAR)
- `LinkedIn (Adam Goodge) <https://www.linkedin.com/in/adam-goodge-33908691/>`_

Daniel Kulik (Machine Learning Developer; MSc Student @ University of the Free State):
Daniel Kulik (Machine Learning Developer; MSc Astrophysics @ University of the Free State):

- Joined 2022 (implemented integration with PyThresh and more)
- `LinkedIn (Daniel Kulik) <https://www.linkedin.com/in/daniel-kulik-148256223>`_
Expand Down
3 changes: 1 addition & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
combo
furo
geomstats
joblib>=1.5
matplotlib
numpy>=1.19
numba>=0.51
pyclustering
pytest
pythresh>=0.3.1
pythresh>=1.0.0
ruptures
scipy>=1.5.1
scikit-learn>=0.22.0
Expand Down
7 changes: 4 additions & 3 deletions pyod/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def predict(self, X, return_confidence=False):

# if this is a PyThresh object
else:
prediction = self.contamination.eval(pred_score)
prediction = self.contamination.predict(pred_score)

if return_confidence:
confidence = self.predict_confidence(X)
Expand Down Expand Up @@ -291,7 +291,7 @@ def predict_confidence(self, X):
prediction = (test_scores > self.threshold_).astype('int').ravel()
# if this is a PyThresh object
else:
prediction = self.contamination.eval(test_scores)
prediction = self.contamination.predict(test_scores)
np.place(confidence, prediction == 0, 1 - confidence[prediction == 0])

return confidence
Expand Down Expand Up @@ -575,7 +575,8 @@ def _process_decision_scores(self):

# if this is a PyThresh object
else:
self.labels_ = self.contamination.eval(self.decision_scores_)
self.contamination.fit(self.decision_scores_)
self.labels_ = self.contamination.labels_
self.threshold_ = self.contamination.thresh_
if not self.threshold_:
self.threshold_ = np.sum(self.labels_) / len(self.labels_)
Expand Down
Loading
Loading