我尝试使用AnomalyDetectionTs()
来自https://github.com/twitter/AnomalyDetection
和https://www.r-bloggers.com/anomaly-detection-in-r/library(AnomalyDetection)
的
数据。在我的示例数据中,有非常摆动的值在图上没有下降曲线(或像模式一样缓慢下降)而不是它应该从它的模式。这个功能对我不起作用。该函数检测到的所有异常点都是正确的和正常的值。
我的示例数据:https ://raw.githubusercontent.com/ieatbaozi/R-Practicing/master/example.csv
df <- read.csv(url("https://raw.githubusercontent.com/ieatbaozi/R-Practicing/master/example.csv"),header = TRUE,stringsAsFactors = FALSE)
df$DateTime <- as.POSIXct(df$DateTime)
library(AnomalyDetection)
ADtest <- AnomalyDetectionTs(df, max_anoms=0.1, direction='both', plot=TRUE)
ADtest$plot
如何通过填充最合适的值来修复这些值?平滑它们以接近它们周围的图案,并且在修复这些值后,所有数据的总值仍然相同。
我的额外问题是:你有什么想法找到它的模式吗?我可以给你更多的信息。非常感谢你的帮助。