Python 中的 ADTK 异常值检测/过滤
我正在尝试解决我所拥有的数据集中的异常情况。这是进程的 CPU 使用率数据。
我查找异常的代码如下所示
outlier_detector = OutlierDetector(LocalOutlierFactor(contamination=0.05))
anomalies = outlier_detector.fit_detect(df_anomaly)
print(anomalies)
异常输出显示如下所示
如何过滤具有 的所有值的异常输出集合中正确?异常输出是数据帧还是其他东西?
I am trying to fine anomalies in the data set I have. This is CPU usage data for a process.
My data looks something like below
My code to find anomalies looks like something below
outlier_detector = OutlierDetector(LocalOutlierFactor(contamination=0.05))
anomalies = outlier_detector.fit_detect(df_anomaly)
print(anomalies)
The anomalies output shows me something like below
How can I filter the anomalies output for all values which have True in the set? Is anomalies output a dataframe or something else?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
GitHub 上的贡献者回答了这个问题。
anomalies 对象是一个
pandas.core.series.Series
您可以将其转换为列表并在您自己的图中使用数据。
The question was answered by Contributors on GitHub.
The anomalies object is a
pandas.core.series.Series
You can convert it to a list and use the data in your own plot.