From 1416b4e41fdd23c63df59f54ce547f9bd0530e71 Mon Sep 17 00:00:00 2001 From: xiaowei Date: Sat, 5 Sep 2026 18:13:53 +0800 Subject: [PATCH] =?UTF-8?q?fix(consolidate):=20eps=201.0->0.4=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=20DBSCAN=20=E8=81=9A=E7=B1=BB=E5=A4=B1=E6=95=88=20(cl?= =?UTF-8?q?usters=3D1->34)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因: bge-m3 向量已归一化(norm=1.0, 距离 p50=0.42-0.75), 旧 eps=1.0 按未归一化数据(p50=1.029)调试, 在归一化空间过大 -> 全部连成1簇 -> consolidate 空转多日 (clusters=1 error 每15min刷) 实测: eps=0.4 -> clusters=34 noise=1030, 能发现重复状态噪音簇(1045条主profile状态同步/961条CBM状态) --- go/internal/consolidate/client.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/go/internal/consolidate/client.go b/go/internal/consolidate/client.go index db0c277..fe84fba 100644 --- a/go/internal/consolidate/client.go +++ b/go/internal/consolidate/client.go @@ -74,9 +74,13 @@ func Run(dataDir, sqlitePath, mode string) (*Result, error) { LLMEndpoint: os.Getenv("LLM_ENDPOINT"), LLMModel: os.Getenv("LLM_MODEL"), LLMApiKey: os.Getenv("LLM_API_KEY"), - Epsilon: 1.0, - // 距离分布: p50=1.029, p95=1.135, max=1.184 - // eps=0.1 → 1435 noise (太严), eps=1.0 → 合理语义聚类, eps=1.5 → 1个巨大cluster + Epsilon: 0.4, + // 距离分布(2026-09-05 实测,bge-m3 归一化向量 norm=1.0): + // 全量3000抽样: p25=0.24 p50=0.75 p95=0.82 + // sidecar 零向量 top-10000 样本: p5=0.09 p50=0.42 p95=1.0 + // eps=1.0(旧值,按未归一化 p50=1.029 调的)→ 归一化空间过大 → clusters=1 聚类失效 + // eps=0.3~0.5 → 有语义簇(能发现重复状态噪音簇: 1045条"主profile状态同步"/961条"CBM状态") + // eps=0.4 = 平衡(2026-09-05 修复,commit 待推) MinPoints: 3, ModelDir: os.Getenv("BGE_MODEL_DIR"), })