Mevsimsel zaman serilerinde birden çok anomali tespiti

R ile Anomali Tespitine Giriş

Alastair Rushworth

Data Scientist

Aylık gelir verileri

head(msales)
  sales month
1 6.068     1
2 5.966     2
3 6.133     3
4 6.230     4
5 6.407     5
6 6.433     6

Grubbs testi burada uygun değil

  • Mevsimsellik olabilir
  • Birden çok anomali olabilir
R ile Anomali Tespitine Giriş

Aylık gelirin görselleştirilmesi

plot(sales ~ month, data = msales, type = 'o')

R ile Anomali Tespitine Giriş

Mevsimsel-Hibrit ESD algoritmasının kullanımı

library(AnomalyDetection)
sales_ad <- AnomalyDetectionVec(x = msales$sales, period = 12, 
                                direction = 'both')

Argümanlar

  • x: değer vektörü
  • period: tekrar eden desenin periyodu
  • direction: küçük ('neg'), büyük ('pos') ya da her ikisi ('both') olan anomalileri bul

Paket indirme: https://github.com/twitter/AnomalyDetection

R ile Anomali Tespitine Giriş

Mevsimsel-Hibrit ESD algoritması çıktısı

sales_ad <- AnomalyDetectionVec(x = msales$sales, period = 12, 
                                direction = 'both')
sales_ad$anoms
  index anoms
1    14 1.561
2   108 2.156
R ile Anomali Tespitine Giriş

Mevsimsel-Hibrit ESD algoritması grafiği

AnomalyDetectionVec(x = msales$sales, period = 12, 
                    direction = 'both', plot = T)

R ile Anomali Tespitine Giriş

Hadi pratik yapalım!

R ile Anomali Tespitine Giriş

Preparing Video For Download...