异常检测中的正类是什么? [英] What is the positive class in anomaly detection?
问题描述
目前,我尝试在 python 中使用 scikit-learn 实现异常检测算法.我将数据集重新标记为 Inliers(正常实例)标记为 1
,而异常值(异常实例)标记为 -1
(参考)
Currently, I try to implement an anomaly detection algorithm with scikit-learn in python. I relabeled the dataset to Inliers (Normal instances) are labelled 1
, while outliers (Anomaly instances) are labelled -1
(Reference)
对于accuracy_score、precision_score、recall_score 和f1_score 的计算,当我设置pos_label=1
或pos_label=-1
时,我得到了不同的值.
For the calculation of accuracy_score, precision_score, recall_score and f1_score I get different values when I set pos_label=1
or pos_label=-1
.
那么在异常检测的上下文中,正类的标签是什么:1
还是-1
?
So what is the label of the positive class in the context of anomaly detection: 1
or -1
?
推荐答案
您有兴趣找出哪些样本是异常值.然后,正类是异常值.
注意:通常,您应该尝试提高召回率而不是准确率,因为您需要减少假阴性(预测异常值是内部值)
You are interested in finding what samples are outliers. Then, positive class is the outliers.
Note: Generally, you should try to improve the recall rather than the precision score, because you need to reduce false negatives (predict that an outlier is an inlier)
这篇关于异常检测中的正类是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!