{% extends 'base.html' %} {% load static %} {% block title %}簇 #{{ cluster.cluster_label }} — 运行 #{{ run.display_id }}{% endblock %} {% block content %}
← 聚类概览

簇 #{{ cluster.cluster_label }} {% if cluster.cluster_label == -1 %}噪声{% endif %}

{{ cluster.size }} 个行 {% if cluster.proportion %} — {{ cluster.proportion|floatformat:1 }}% 占总{% endif %} {% if cluster.silhouette_score is not None %} — 轮廓系数: {{ cluster.silhouette_score|floatformat:4 }}{% endif %}

{% if nl_summary %}
{{ nl_summary }}
{% endif %}

📊 特征分析 {{ features|length }} 个特征

{% if features %} {% for f in features %} {% endfor %}
# 特征名 区分度 均值 标准差 中位数 P25 P75
{{ forloop.counter }} {{ f.feature_name }} {{ f.distinguishing_score|floatformat:3 }} {{ f.mean|floatformat:3|default:"-" }} {{ f.std|floatformat:3|default:"-" }} {{ f.median|floatformat:3|default:"-" }} {{ f.p25|floatformat:3|default:"-" }} {{ f.p75|floatformat:3|default:"-" }}
{% else %}

该簇无特征数据

{% endif %}
{% if cluster.cluster_label != -1 %} {# SVD-extracted features (from _run_clustering_pipeline cluster_svd_extract) have higher distinguishing scores #} {% with svd_features=features|slice:":5" %} {% if svd_features %}

🔬 SVD 关键特征 Top 5 按区分度

{% for f in svd_features %}
{{ f.feature_name }}
Score: {{ f.distinguishing_score|floatformat:2 }} | 均值: {{ f.mean|floatformat:2 }} | 标准差: {{ f.std|floatformat:2 }}
{% endfor %}
{% endif %} {% endwith %} {% endif %}

📋 数据行 {{ row_data|length }} 条

{% if row_data %}
{% for k, v in row_data.0.items %} {% endfor %} {% for row in row_data %} {% for k, v in row.items %} {% endfor %} {% endfor %}
#{{ k }}
{{ forloop.counter }}{{ v|default:"-" }}
{% else %}

该簇无数据行

{% endif %}
{% endblock %}