1. 案例定位

比較 Clustering 的 Distance Measures,並說明 Variable Scale 為何需要 Standardization。

2. 學習目標

辨識 Euclidean、Squared Euclidean、Mahalanobis Distance 的原書定位,以及不同尺度造成的偏差。

3. 案例情境

Clustering 需要以 Distance 量化 Observations 的 Closeness;若 Variables 的 Magnitude 不同,距離可能被某個 Variable 主導。

4. 開始資料

方法/情境 原書說明
Euclidean 多維 Euclidean Space 中的直線距離
Squared Euclidean 對較大距離給予更高懲罰
Mahalanobis 使用 Standard Deviations 衡量距離
尺度例子 Distance from City Centre 與 Income

5. 分析方法

先檢查 Variables 的 Scale/Magnitude,再 Standardize,使各變數可比較,之後才計算 Closeness 並執行 Clustering。

6. 計算結果

原書此段沒有提供具體 Observation 數值,因此不自行計算 Distance。

7. 結果分析與管理解讀

Distance Measure 與 Standardization 是模型設定,不是中性的操作細節;尺度差異會影響最後 Cluster Membership。

8. AI Prompt

「檢查以下 Clustering Variables 的量尺是否可直接比較,指出哪些可能需要 Standardization;不要自行產生資料值。」

9. 思考/What-if

題目: Income 數值範圍遠大於距離市中心時,未 Standardize 有何風險?

參考解答: 原書指出 Closeness Measure 會因兩者不在相似 Scale 而被扭曲。

10. 資料說明