I have built a custom algorithm for semi-supervised anomaly detection and here is my output example as following with probability threshold set to 0.05 and 1 = outlier, 0 = inlier:
X1 X2 X3 Probability Threshold 1 2 3 0.01 1 4 5 6 0.015 1 7 8 9 0.04 1 10 11 12 0.06 0 13 14 15 0.1 0
Now using such data, how can I build the decision function/score similar to the one in scikit-learn?
My ultimate objective is to able to produce precision/recall plot, ROC plot for this algorithm and compare its performance to other scikit-learn and PyOD library algorithms.
The only thing that I was able to come up with so far is to loop through different thresholds of probability and at each iteration set accordingly whether a point is outlier or not and compute precision/recall/tpr/fpr metrics. However, I understand that this is not the proper way to compute the decision function and, thus, it cannot be compared to scikit-learn algorithms.