{% set report_data = template_data.get('CHART_DATA_JSON', {}) %} {% set overview = report_data.get('overview', {}) %} {% set anomaly = report_data.get('anomaly_overview', {}) %} {% macro source(path, label) -%} data-dbgpt-artifacts="{{ARTIFACT_ID_CHART_DATA_JSON}}" data-dbgpt-artifact-selectors='{"{{ARTIFACT_ID_CHART_DATA_JSON}}":{"field":"CHART_DATA_JSON","path":{{ path|tojson }}}}' data-dbgpt-evidence-label="{{ label }}" {%- endmacro %} {% macro datum(value, path, suffix='') -%} {% if value is none or value == '' %}--{% else %}
{{ value|round(2) if value is number else value }}{{ suffix }}
{% endif %} {%- endmacro %} {% macro metric(label, value, path, hint, suffix='') -%}
{{ label }}
{{ datum(value, path, suffix) }}
{{ hint }}
{%- endmacro %}
{{REPORT_TITLE}}
{{REPORT_SUBTITLE}}
数据规模
{{ datum(overview.get('rows'), ['overview','rows'], ' 行') }}
样本量与字段规模
完整度
{{ datum(overview.get('completeness_pct'), ['overview','completeness_pct'], '%') }}
缺失与重复情况
核心指标
{{ datum(report_data.get('primary_metric'), ['primary_metric']) }}
自动识别的主分析指标
异动差距
{{ datum(anomaly.get('gap'), ['anomaly_overview','gap']) }}
高低分组差异概览
01
报告摘要
快速概览数据规模、重点发现和关键判断
{{EXEC_SUMMARY}}
{{ metric('样本行数', overview.get('rows'), ['overview','rows'], '总记录数') }} {{ metric('字段数量', overview.get('cols'), ['overview','cols'], '总列数') }} {{ metric('完整率', overview.get('completeness_pct'), ['overview','completeness_pct'], '缺失越低越好', '%') }} {{ metric('重复记录', overview.get('duplicate_rows'), ['overview','duplicate_rows'], '重复行检查') }} {{ metric('内存占用', overview.get('memory_kb'), ['overview','memory_kb'], '数据量级', ' KB') }} {{ metric('主分析指标', report_data.get('primary_metric'), ['primary_metric'], '后续异动分析基准') }}
02
数据概览与质量检查
检查数据结构、字段类型、缺失情况与整体质量
字段缺失率分布
字段类型结构
03
数值指标分布特征
观察核心数值列的分布形态、离散程度和偏态特征
{% for column in template_data.CHART_DATA_JSON.get("distributions", {}) or {} %}
{% endfor %}
Distribution Insights
{{DISTRIBUTION_INSIGHTS}}
04
特征分析与结构分析
从分类结构、排名对比和统计画像理解数据特征
分类维度结构
{% for column in template_data.CHART_DATA_JSON.get("categories", {}) or {} %}
{% endfor %}
Categorical Insights
{{CATEGORICAL_INSIGHTS}}
Top / Bottom 排名特征
{% if template_data.CHART_DATA_JSON.get("top_bottom", {}).get("top5") %}
{% endif %} {% if template_data.CHART_DATA_JSON.get("top_bottom", {}).get("bottom5") %}
{% endif %}
05
关系分析与异常识别
关注变量联动、异常点分布以及结构性关系特征
相关性与散点关系
Correlation Insights
{{CORRELATION_INSIGHTS}}
异常值与箱线分布
{% for column, outlier in report_data.get('outliers', {}).items() %}
{{ datum(column, ['outliers',column]) }}
{{ datum(outlier.get('count'), ['outliers',column,'count']) }} ({{ datum(outlier.get('pct'), ['outliers',column,'pct'], '%') }})
{% endfor %}
06
数据异动概述
围绕核心指标概括波动、分层差距、异常比例和主要异动特征
异动概览指标
{{ metric('核心指标', anomaly.get('metric'), ['anomaly_overview','metric'], '自动识别') }}
均值 / 中位数
{{ datum(anomaly.get('mean'), ['anomaly_overview','mean']) }} / {{ datum(anomaly.get('median'), ['anomaly_overview','median']) }}
中心位置
P10 / P90
{{ datum(anomaly.get('q10'), ['anomaly_overview','q10']) }} / {{ datum(anomaly.get('q90'), ['anomaly_overview','q90']) }}
分位带
{{ metric('高低组差距', anomaly.get('gap'), ['anomaly_overview','gap'], '高位组均值 - 低位组均值') }} {{ metric('异常值占比', anomaly.get('outlier_pct'), ['anomaly_overview','outlier_pct'], '主指标异常比例', '%') }}
组别规模
{{ datum(anomaly.get('top_group_size'), ['anomaly_overview','top_group_size']) }} / {{ datum(anomaly.get('bottom_group_size'), ['anomaly_overview','bottom_group_size']) }}
高位组 / 低位组
时间/序列视角(如适用)
Time Series / Anomaly Insights
{{TIME_SERIES_INSIGHTS}}
07
归因分析模块
在基础分析之上,补充关键驱动维度、组间差异和可能原因线索
主要驱动维度排序
归因线索摘要
{% for item in report_data.get('driver_analysis', {}).get('items', [])[:5] %} {% set item_path = ['driver_analysis','items',loop.index0] %}
{{ datum(item.get('name'), item_path + ['name']) }}
相关系数 {{ datum(item.get('corr'), item_path + ['corr']) }} · 高位组均值 {{ datum(item.get('top_mean'), item_path + ['top_mean']) }} · 低位组均值 {{ datum(item.get('bottom_mean'), item_path + ['bottom_mean']) }} · 组间差异强度 {{ datum(item.get('gap_ratio'), item_path + ['gap_ratio']) }}
{{ datum(item.get('score'), item_path + ['score']) }}
{% endfor %}
08
分析结果与统计明细
通过统计表和全局画像沉淀分析结果,作为原因推测的证据基础
{% set has_radar = (report_data.get('numeric_cols', [])|length >= 3 and report_data.get('distributions', {}).values()|selectattr('counts', 'defined')|selectattr('counts')|list|length >= 3) %}
{% if has_radar %}
特征轮廓雷达
{% endif %}
统计摘要表
{% set stats = report_data.get('stats_table', {}) %} {% if stats.get('rows') %}
{% for header in stats.get('headers', []) %}
{{ header }}
{% endfor %}
{% for row in stats.get('rows', []) %}{% set row_index = loop.index0 %}
{% for cell in row %}
0 %} class="num"{% endif %}>{{ datum(cell, ['stats_table','rows',row_index,loop.index0]) }}
{% endfor %}
{% endfor %}
{% endif %}
09
原因推测、总结与建议
对前述现象进行收束,区分证据与推测,并给出行动建议
{{CONCLUSIONS}}