怎样评价时间序列异常检测的效果( 三 )

如果你想想象正在发生的事情,现在尝试另一个绘图功能是一个好点plot_anomaly_decomposition()。它只适用于单个时间序列,因此我们只需选择一个即可查看。“季节”正在消除每周的循环季节性。趋势是平滑的,这对于消除集中趋势而不过度拟合是合乎需要的。最后,分析剩余部分以检测最重要的异常值的异常。
tidyverse_cran_downloads %\u0026gt;% # Anomalize time_decompose(count, method = "stl", frequency = "auto", trend = "auto") %\u0026gt;% anomalize(remainder, method = "iqr", alpha = 0.05, max_anoms = 0.2) %\u0026gt;% # Plot Anomaly Decomposition plot_anomaly_decomposition() + ggtitle("Lubridate Downloads: Anomaly Decomposition")


?
异常下限和上限最后一步是围绕“观察”值创建下限和上限。这是工作time_recompose(),它重新组合观察值周围的异常的下限和上限。创建了两个新列:“recomposed_l1”(下限)和“recomposed_l2”(上限)。
## # A time tibble: 6,375 x 11 ## # Index: date ## # Groups: package ## package date observed season trend remainder remainder_l1 ## ## 1 tidyr 2017-01-01 873. -2761. 5053. -1418. -3748. ## 2 tidyr 2017-01-02 1840. 901. 5047. -4108. -3748. ## 3 tidyr 2017-01-03 2495. 1460. 5041. -4006. -3748. ## 4 tidyr 2017-01-04 2906. 1430. 5035. -3559. -3748. ## 5 tidyr 2017-01-05 2847. 1239. 5029. -3421. -3748. ## 6 tidyr 2017-01-06 2756. 367. 5024. -2635. -3748. ## 7 tidyr 2017-01-07 1439. -2635. 5018. -944. -3748. ## 8 tidyr 2017-01-08 1556. -2761. 5012. -695. -3748. ## 9 tidyr 2017-01-09 3678. 901. 5006. -2229. -3748. ## 10 tidyr 2017-01-10 7086. 1460. 5000. 626. -3748. ## # ... with 6,365 more rows, and 4 more variables: remainder_l2 , ## # anomaly , recomposed_l1 , recomposed_l2
让我们看一下“lubridate”数据。我们可以使用plot_anomalies()和设置time_recomposed = TRUE。此功能适用于单个和分组数据。
time_decompose(count, method = "stl", frequency = "auto", trend = "auto") %\u0026gt;% anomalize(remainder, method = "iqr", alpha = 0.05, max_anoms = 0.2) %\u0026gt;% time_recompose() %\u0026gt;% # Plot Anomaly Decomposition plot_anomalies(time_recomposed = TRUE) + ggtitle("Lubridate Downloads: Anomalies Detected")
【怎样评价时间序列异常检测的效果】 

推荐阅读
- 聪明人养花,这3种“花”怎样也要养一盆,每年能省不少医药费
- 互联网怎样解决“家政服务上门速度慢”的问题
- 怎样看待从1月8号起,QQ钱包开始提现收费
- 银行it人怎样转型
- 汽车|冬天怎样让车内温度快速升高?座椅加热的最佳使用方式二,外循环的作用总结
- 怎样进入通信行业
- 怎样评价扶他柠檬茶的小说《云养汉》的结尾
- 怎样成为一名合格的Python程序员?
- 怎样评价华为、诺基亚、中兴中标中国移动高端路由交换设备扩容集采
- 怎样评价类似前橙会、百老汇、南极圈这样类型的离职帮抱团,对企业的积极意义和消极意义
