机器学习之相似性度量

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)

1.2 常用度量方式:以n维样本 x 1 = ( x 11 , x 12 , . . . , x 1 n ) x_1 = (x_{11}, x_{12},...,x_{1n}) x1=(x11,x12,...,x1n) x 2 = ( x 21 , x 22 , . . . , x 2 n ) x_2 = (x_{21}, x_{22},...,x_{2n}) x2=(x21,x22,...,x2n) 为例

  • 闵可夫斯基距离(对应P-范数): d i s t ( x 1 , x 2 ) = ( ∑ u = 1 n ∣ x 1 u − x 2 u ∣ p ) 1 p dist(x_1,x_2)=(\sum_{u=1}^n |x_{1u}-x_{2u}|^p)^\frac{1}{p} dist(x1,x2)=(u=1nx1u

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值