0.引言
在建模的过程中,当需要整理出两两样本之间的联系时,通常会使用“相似性(similarity)”来描述这种联系。在一般语境中,我们通常会用“距离(distance)”来代表这种联系。一般来说,相似性和距离代表的含义是相同的。而对距离的正确建模能帮助模型更快的挖掘出隐含在数据分布之间的联系。
1.两样本的相似度的衡量
1.1 基本性质
- 非负性: d i s t ( x i , x j ) ≥ 0 dist(x_i,x_j)\ge0 dist(xi,xj)≥0
- 同一性: d i s t ( x i , x i ) = 0 dist(x_i,x_i)=0 dist(xi,xi)=0
- 对称性: d i s t ( x i , x j ) = d i s t ( x j , x i ) dist(x_i,x_j)=dist(x_j,x_i) dist(xi,xj)=dist(xj,xi)
- 直递性: d i s t ( x i , x j ) = d i s t ( x i , x k ) + d i s t ( x k , x j ) dist(x_i,x_j)=dist(x_i,x_k)+dist(x_k,x_j) dist(xi,xj)=dist(xi,xk)+dist(xk,xj)