↑↑↑关注后"星标"Datawhale
每日干货 & 每月组队学习,不错过
Datawhale干货
内容:异常检测,来源:Coggle数据科学
时序异常检测并不困难,如果你找对方法则可以在今年KDD比赛中获取比较好的成绩。本文将使用tsod
库完成简单的异常检测。
tsod介绍
tsod
可以完成时序数据的异常检测,是一个比较新的库,但使用起来非常方便。
https://github.com/DHI/tsod
https://github.com/DHI/tsod/blob/main/notebooks/Getting%20started.ipynb
区间异常检测
如果我们能提前确定好指标的范围,则可以依次进行判定异常。
# 最小值与最大值
rd = tsod.RangeDetector(min_value=0.01, max_value=2.0)
res = rd.detect(series)
series[res]
将识别结果进行展示:
常数波动检测
cd = tsod.ConstantValueDetector()
res = cd.detect(series)
series[res]
将识别结果进行展示:
范围+常数组合检测
combined = tsod.CombinedDetector([tsod.RangeDetector(max_value=2.0),
tsod.ConstantValueDetector()])
res = combined.detect(series)
series[res]
将识别结果进行展示:
梯度固定检测
cgd = tsod.ConstantGradientDetector()
res = cgd.detect(series)
将识别结果进行展示:
滚动聚合加方差检测
rsd = tsod.RollingStandardDeviationDetector(window_size=10, center=True)
rsd.fit(normal_data)
将识别结果进行展示:
一阶差分检测
drd = tsod.DiffDetector()
drd.fit(normal_data)
将识别结果进行展示:
交流群
KDD 顶会赛事交流群
特邀分享:郑冠杰,上海交通大学助理教授,美国宾州州立大学博士
内容:KDD Cup 赛题3背景知识及解析
时间:本周六晚 20:00 - 20:30
公众号后台回复 “kdd” 可邀请进群
整理不易,点赞三连↓