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

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

第 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% 归咎于舒张压值。

  • 要确定此示例中第二行所代表的点的方向是否异常,请参阅名为 DIRECTION 的 JSON 字段。在本例中,舒张压和收缩压值均标记为 HIGH。要确定这些方向正确的置信度,请参阅名为 STRENGTH 的 JSON 字段。在此示例中,算法更加确信舒张值太高。事实上,舒张压读数的正常值通常为 60—80,而 123 远高于预期值。