1. 程式人生 > >機器學習筆記(十四):異常檢測

機器學習筆記(十四):異常檢測

目錄

1)Problem motivation

2)Gaussian distribution

3)Algorithm

4)Developing and evaluating an anomaly detection system

5)Anomaly detection vs. supervised learning

6)Choosing what features to use


1)Problem motivation

下面是異常檢測的兩個例子:識別欺騙和檢測資料中心

2)Gaussian distribution

我們來回顧一下大學時學的高斯分佈:

                                                                   p(x;u;\sigma)=\frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{(x-u)^2}{2\sigma^2}}

下面是高斯分佈的例子:

在實際應用中,我們可以這樣求引數:

\mu =\frac{1}{m}\sum_{i=1}^{m}x^{(i)}

\sigma^2=\frac{1}{m}\sum_{i=1}^{m}(x^{(i)}-\mu)^2

3)Algorithm

1.資料集:{x^{1},x^{2},...,x^{m}}

2.計算每一個特徵的\mu;\sigma^2;

3.概率計算:p(x)=\prod_{j=1}^{n}p(x_j;\mu_j;\sigma^2_j)

4)Developing and evaluating an anomaly detection system

具體的評價方法如下:

1)根據訓練集資料,我們估計特徵的平均值和方差並構建模型;

2)對交叉驗證集,我們嘗試使用不同的\varepsilon作為閾值,並根據F1值或者準確率與召回率選擇閾值;

3)在測試集上進行預測;

5)Anomaly detection vs. supervised learning

6)Choosing what features to use

1)將資料轉換為高斯分佈;

2)誤差分析;

3)構建新特徵;