📏 Euclidean Distance Calculator
Compute the Euclidean distance and cosine similarity between two vectors. Used for feature similarity, nearest-neighbour checks and clustering analysis.
📐 計算公式 / 原理
歐氏距離 = √[Σ(aᵢ − bᵢ)²];曼哈頓距離 = Σ|aᵢ − bᵢ|;餘弦相似度 = (a·b)/(‖a‖·‖b‖)
三種常用向量度量並列給出:歐氏看絕對位置差,受量綱影響需先標準化;曼哈頓按軸累加,在高維稀疏場景更穩;餘弦只看夾角、忽略模長,因此常用於 embedding 與文本相似度比較。
📐 計算公式與說明
歐氏距離 = √Σ(aᵢ−bᵢ)²
餘弦相似度 = A·B / (|A||B|)
餘弦相似度 = A·B / (|A||B|)
餘弦相似度範圍為 [−1, 1]。