数据挖掘中的异常值检测算法

一、关于异常检测

异常检测(outlier detection)在以下场景:

  • 数据预处理
  • 病毒木马检测
  • 工业制造产品检测
  • 网络流量检测、
  • 信用卡诈骗

下面主要介绍一些检测算法,后续还会更新。。。

1. OneClassSVM

One Class SVM是指你的training data只有一类positive(或者negative)的data,而没有其他的类。在这里,你需要learn的实际上是你training data的boundary。而这时不能使用maximum margin了。

这样就变成了与SVM类似的最优化问题,将其转换为拉格朗日函数。。。

具体原理可见《图解机器学习》

sklearn实现:OneClassSVM

主要参考官网的该案例:One-class SVM with non-linear kernel (RBF)

2. 局部异常因子算法-Local Outlier Factor(LOF)

具体原理可见《图解机器学习》

python实现的lof算法: 
https://github.com/damjankuznar/pylof 

https://github.com/wangyibo360/pylof 

3.iForest (Isolation Forest)孤立森林 

详情见:https://www.jianshu.com/p/5af3c66e0410

代码实现:

 http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.IsolationForest.html

原文地址:https://www.cnblogs.com/chaofn/p/8670738.html