Calculating anomaly score for Anomaly detection using One-Class SVM

a 夏天 提交于 2019-12-13 03:55:40

问题


I have a question about Calculating anomaly score for Anomaly detection using One-Class SVM. My question is that: How can I calculate it using decision_function(X), just the way I calculate anomaly score in Isolation forest? Thanks a lot,


回答1:


In Isolation Forests, anomaly score is a measure of the deviation of average length of the path required to single out a particular observation from the average length of path required to single out a "normal" observation

The average here is taken over all the different trees that are used. Since SVM is not an ensemble method - this notion of anomaly score does not directly apply.

One way, and I don't know how statistically/scientifically sound this is, of measuring an anomaly score is to build multiple SVM classifiers based on a subset of predictors. You could then use the percentage of times a particular point is classified as an outlier as a proxy for an anomaly score.




回答2:


Yes, you have to use decision_function() as the measure of anomaly score in one class SVM.

Have a look at this example, you might get better understanding.

clf.decision_function(X_test)
# returns the signed distance to the separating hyperplane.
# Signed distance is positive for an inlier and negative for an outlier.


来源:https://stackoverflow.com/questions/53956538/calculating-anomaly-score-for-anomaly-detection-using-one-class-svm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!