【问题标题】:Save the output of azure's multi-variate anomaly detection保存天蓝色多元异常检测的输出
【发布时间】:2021-11-21 16:54:35
【问题描述】:

我正在尝试 azure 的多变量异常检测。我这样打印输出, 。使用,

for r in result.results:
    print(f"timestamp: {r.timestamp}, is anomaly: {r.value.is_anomaly}, scores: {r.value.score}, severities: {r.value.severity}, contributors: {r.value.contributors}")

但我想将它保存为像这样的 .csv 文件

--------------------------------------------------------------
|timestamp          | is anomaly|severity|score|contributors |
--------------------------------------------------------------
|2021, 1, 2, 12, 0  | False     |  0.33  | 0.0 |   None      |
|2021, 1, 2, 12, 1  | True      |  1.7   |   1 |   None      |
|2021, 1, 2, 12, 3  | False     |  0.98  | 0.0 |   None      |

【问题讨论】:

    标签: python pandas azure csv anomaly-detection


    【解决方案1】:

    试试这个:

    print(f"timestamp,is anomaly,scores,severities,contributors")
    for r in result.results:
        print(",".join(str(val) for val in [r.timestamp, r.value.is_anomaly, r.value.score, r.value.severity, r.value.contributors]))
    
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-06-14
      • 2014-08-21
      • 2013-05-03
      • 2020-04-15
      • 2014-03-27
      • 1970-01-01
      • 1970-01-01
      • 2021-02-19
      相关资源
      最近更新 更多