步骤 3 检查结果 - Amazon Kinesis Data Analytics for SQL 应用程序开发人员指南
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 AWS 服务入门

如果我们为英文版本指南提供翻译,那么如果存在任何冲突,将以英文版本指南为准。在提供翻译时使用机器翻译。

步骤 3 检查结果

当您对此示例运行 SQL 代码时,首先会看到异常分数等于零的行。这种情况发生在初始学习阶段。然后,您会得到类似如下的结果:

ROWTIME SYSTOLIC DIASTOLIC BLOODPRESSURELEVEL ANOMALY_SCORE ANOMALY_EXPLANATION 27:49.0 101 66 NORMAL 0.711460417 {"Systolic":{"DIRECTION":"LOW","STRENGTH":"0.0922","ATTRIBUTION_SCORE":"0.3792"},"Diastolic":{"DIRECTION":"HIGH","STRENGTH":"0.0210","ATTRIBUTION_SCORE":"0.3323"}} 27:50.0 144 123 HIGH 3.855851061 {"Systolic":{"DIRECTION":"HIGH","STRENGTH":"0.8567","ATTRIBUTION_SCORE":"1.7447"},"Diastolic":{"DIRECTION":"HIGH","STRENGTH":"7.0982","ATTRIBUTION_SCORE":"2.1111"}} 27:50.0 113 69 NORMAL 0.740069409 {"Systolic":{"DIRECTION":"LOW","STRENGTH":"0.0549","ATTRIBUTION_SCORE":"0.3750"},"Diastolic":{"DIRECTION":"LOW","STRENGTH":"0.0394","ATTRIBUTION_SCORE":"0.3650"}} 27:50.0 105 64 NORMAL 0.739644157 {"Systolic":{"DIRECTION":"HIGH","STRENGTH":"0.0245","ATTRIBUTION_SCORE":"0.3667"},"Diastolic":{"DIRECTION":"LOW","STRENGTH":"0.0524","ATTRIBUTION_SCORE":"0.3729"}} 27:50.0 100 65 NORMAL 0.736993425 {"Systolic":{"DIRECTION":"HIGH","STRENGTH":"0.0203","ATTRIBUTION_SCORE":"0.3516"},"Diastolic":{"DIRECTION":"LOW","STRENGTH":"0.0454","ATTRIBUTION_SCORE":"0.3854"}} 27:50.0 108 69 NORMAL 0.733767202 {"Systolic":{"DIRECTION":"LOW","STRENGTH":"0.0974","ATTRIBUTION_SCORE":"0.3961"},"Diastolic":{"DIRECTION":"LOW","STRENGTH":"0.0189","ATTRIBUTION_SCORE":"0.3377"}}
  • RANDOM_CUT_FOREST_WITH_EXPLANATION 函数中的算法看到 Systolic (收缩压) 和 Diastolic (舒张压) 列为数字,于是将它们作为输入。

  • BloodPressureLevel 列包含文本数据,因此不会被算法所考虑。该列只是一个可视化助手,用来帮助您快速发现本例中的正常、高、低血压水平。

  • ANOMALY_SCORE 列中,分数越高的记录越异常。此示例结果集中的第二个记录最异常,异常分数为 3.855851061。

  • 要了解算法所考虑的每个数字列在多大程度上造成异常评分,请参阅 ATTRIBUTION_SCORE 列中名为 ANOMALY_SCORE 的 JSON 字段。对于该示例结果集中的第二行,SystolicDiastolic 列造成异常的比例为 1.7447:2.1111。换句话说,异常分数原因的 45% 归咎于收缩压值,55% 归咎于舒张压值。

  • 要确定该样本中第二行表示的点的方向,请参阅名为JSON的字段 DIRECTION。舒张压和收缩压均标记为 HIGH 在这种情况下,要确定这些方向正确的信心,请查看名为JSON的字段 STRENGTH。在本示例中,算法更加确定舒张压值高。事实上,舒张压读数的正常值通常为 60–80,而 123 远高于预期值。