Created
December 1, 2021 01:37
-
-
Save lynnssi/28c1151596b9cfa3118a182c852a238d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyod.models.lof import LOF | |
clf_name = 'LOF' | |
clf = LOF() | |
clf.fit(X_train) | |
test_scores = clf.decision_function(X_test) | |
roc = round(roc_auc_score(y_test, test_scores), ndigits=4) | |
prn = round(precision_n_scores(y_test, test_scores), ndigits=4) | |
print(f'{clf_name} ROC:{roc}, precision @ rank n:{prn}') | |
>> LOF ROC:0.9656, precision @ rank n:0.8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment