本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
查看生产模型特征归因偏移报告
默认启动您设置的计划后,您需要等待其首次执行开始,然后停止该计划以避免产生费用。
要查看报告,请使用以下代码:
schedule_desc = model_explainability_monitor.describe_schedule() execution_summary = schedule_desc.get("LastMonitoringExecutionSummary") if execution_summary and execution_summary["MonitoringExecutionStatus"] in ["Completed", "CompletedWithViolations"]: last_model_explainability_monitor_execution = model_explainability_monitor.list_executions()[-1] last_model_explainability_monitor_execution_report_uri = last_model_explainability_monitor_execution.output.destination print(f'Report URI: {last_model_explainability_monitor_execution_report_uri}') last_model_explainability_monitor_execution_report_files = sorted(S3Downloader.list(last_model_explainability_monitor_execution_report_uri)) print("Found Report Files:") print("\n ".join(last_model_explainability_monitor_execution_report_files)) else: last_model_explainability_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_explainability_monitor_execution: model_explainability_violations = last_model_explainability_monitor_execution.constraint_violations() if model_explainability_violations: print(model_explainability_violations.body_dict)
如果您的模型部署到实时端点,则可以在 SageMaker Studio 中查看分析结果和 CloudWatch 指标的可视化效果,方法是选择 Endpoints 选项卡,然后双击该端点。