检查报告以查找数据偏差偏差 - Amazon SageMaker
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 AWS 服务入门

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

检查报告以查找数据偏差偏差

如果您无法检查 SageMaker Studio 中生成的报告中的监控结果,您可以按如下方式输出这些报告:

schedule_desc = model_bias_monitor.describe_schedule() execution_summary = schedule_desc.get("LastMonitoringExecutionSummary") if execution_summary and execution_summary["MonitoringExecutionStatus"] in ["Completed", "CompletedWithViolations"]: last_model_bias_monitor_execution = model_bias_monitor.list_executions()[-1] last_model_bias_monitor_execution_report_uri = last_model_bias_monitor_execution.output.destination print(f'Report URI: {last_model_bias_monitor_execution_report_uri}') last_model_bias_monitor_execution_report_files = sorted(S3Downloader.list(last_model_bias_monitor_execution_report_uri)) print("Found Report Files:") print("\n ".join(last_model_bias_monitor_execution_report_files)) else: last_model_bias_monitor_execution = None print("====STOP==== \n No completed executions to inspect further. Please wait till an execution completes or investigate previously reported failures.")

如果与基准相比存在违规情况,此处将列出这些违规情况:

if last_model_bias_monitor_execution: model_bias_violations = last_model_bias_monitor_execution.constraint_violations() if model_bias_violations: print(model_bias_violations.body_dict)

在 SageMaker Studio 中,您可以通过选择 CloudWatchEndpoints 选项卡,然后双击终端节点来查看分析结果和指标的可视化。