您的位置:首页 > 其它

使用Twitter异常检测框架遇到的坑

2018-11-08 22:45 387 查看

  在Github上搜索“Anomaly Detection”,Twitter的异常检测框架(基于R语言)高居榜首,可见效果应该不错:

   但是活跃度并不高,3-4年没人维护了:

    因此在使用时难免会遇到一些坑,整个使用方式如下(红色部分,就是直接在RStudio中运行时,可能有异常的地方):

install.packages("devtools")
devtools::install_github("twitter/AnomalyDetection")
library(AnomalyDetection)

data(raw_data)
res = AnomalyDetectionTs(raw_data, max_anoms=0.02, direction='both', plot=TRUE)
res$plot

1.devtools::install_github("twitter/AnomalyDetection")

  异常如下:

Error in process_initialize(self, private, command, args, stdin, stdout,  :
processx error, setup stdio: #2 The system cannot find the file specified.
at 'win/processx.c:984'
In addition: Warning messages:
1: In untar2(tarfile, files, list, exdir) :
skipping pax global extended headers
2: In untar2(tarfile, files, list, exdir) :
skipping pax global extended headers

   该问题没有很好解决,同事用RStudio下载是可以的,然后把下载到R下library里的AnomalyDetection拷贝到我机器上对应目录下

2.res = AnomalyDetectionTs(raw_data, max_anoms=0.02, direction='both', plot=TRUE)

 异常如下:

Error: Column x is a date/time and must be stored as POSIXct, not POSIXlt

  该问题已经有人解决了,并且提交了PR:https://github.com/twitter/AnomalyDetection/pull/92

  所以重新下载了修复后的异常检测代码:

devtools::install_github("caijun/AnomalyDetection")

 

    另外在简书上发现一个大神的帖子:https://www.jianshu.com/p/02ba9ce11656,从该大神其他帖子可以看出,是个机器学习拥趸。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: