大家好,我是Peter~
今天给大家分享一篇关于异常检测的文章,重点介绍了14种公开网络上一些常见的异常检测方法(附资料来源和代码)。
1
『基于分布的方法』
1. 3sigma
基于正态分布,3sigma准则认为超过3sigma的数据为异常点。
图1: 3sigma
def three_sigma(s):
mu, std = np.mean(s), np.std(s)
lower, upper = mu-3*std, mu+3*std
return lower, upper
2. Z-score
Z-score为标准分数,测量数据点和平均值的距离,若A与平均值相差2个标准差,Z-score为