【发布时间】:2022-01-07 09:13:15
【问题描述】:
Tensorflow 数据验证提供了一种查找数据异常的方法。
但是,我只能找到一种方法来提供异常的摘要版本(通过使用 tfdv.validate_statistics 和 tfdv.display_anomalies)。
是否有某个参数的功能可以传递它而不是报告摘要,而是返回具有异常的行以及什么异常类型?
按照下面的例子:
import pandas as pd
import tensorflow_data_validation as tfdv
from tensorflow_metadata.proto import schema_pb2
df_stats = tfdv.generate_statistics_from_dataframe(df)
schema = tfdv.infer_schema(statistics=df_stats)
tfdv.set_domain(schema, "c1", schema_pb2.IntDomain(min=1, max=3))
anomalies = tfdv.validate_statistics(statistics=df_stats, schema=schema)
tfdv.display_anomalies(anomalies)
有没有办法利用 TFDV 返回类似的东西:
| index | c1 | c2 | anomaly_type |
|---|---|---|---|
| 3 | 100 | Z | c1 Out-of-range values |
| 4 | 100000 | A | c1 Out-of-range values |
如果没有,您会推荐什么替代方案?
【问题讨论】:
标签: python tensorflow tensorflow-data-validation