兰德系数、调整兰德系数

兰德系数与调整兰德系数是衡量聚类效果的指标。兰德系数评估两个划分的相似性,取值范围在0到1之间,1表示完美匹配。调整兰德系数解决了随机划分时兰德系数不趋于0的问题,其值在-1到1之间,正值表示聚类效果良好,1表示完全一致。调整兰德系数适用于不同形状的聚类比较,但需要真实类别信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

调整兰德系数(Adjusted Rand index)用于聚类模型的性能评估,但是其需要true_label,在正式介绍兰德系数之前,先介绍调整兰德系数的前身,兰德系数。

兰德系数(Rand index)

给定 n n 个对象集合S={O1,O2,....,On},假设 U={u1,...,uR} U = { u 1 , . . . , u R } V={v1,...,vC} V = { v 1 , . . . , v C } 表示S的两个不同划分并且满足 Ri=1ui=S=Cj=1vj ⋃ i = 1 R u i = S = ⋃ j = 1 C v j , uiui==vjvj u i ⋂ u i ∗ = ∅ = v j ⋂ v j ∗ ,其中 1iiR 1 ≤ i ≠ i ∗ ≤ R 1jjC 1 ≤ j ≠ j ∗ ≤ C

假设 U U 是外部评价标准即true_label,而V是聚类结果。设定四个统计量:

  • a a 为在U中为同一类且在 V V 中也为同一类别的数据点对数
  • b为在 U U 中为同一类但在V中却隶属于不同类别的数据点对数
  • c c 为在U中不在同一类但在 V V 中为同一类别的数据点对数
  • d为在 U U 中不在同一类且在V中也不属于同一类别的数据点对数
Class\ClusterSame ClusterDifferent ClusterSumU
Same Classaba+b
Different Classcdc+d
SumVa+cb+da+b+c+d

此时,兰德系数为:

RI=a+da+b+c+d R I = a + d a + b + c + d

兰德系数的值在[0,1]之间,当聚类结果完美匹配时,兰德系数为1。

调整兰德系数(Adjusted Rand index)

兰德系数的问题在于对于两个随机的划分,其兰德系数值不是一个接近于0的常数。Hubert和Arabie在1985年提出了调整兰德系数,调整兰德系数假设模型的超分布为随机模型,即 U U V的划分为随机的,那么各类别和各簇的数据点数目是固定的。

假设 nij n i j 表示同在类别 ui u i 和簇 vj v j 内的数据点数目, ni. n i . 为类 ui u i 的数据点数目, n.j n . j 为簇 vj v j 的数目,如下表:

Class\Cluster v1 v 1 v2 v 2 vC v C Sums
u1 u 1 n11 n 11 n12 n 12 n1C n 1 C n1. n 1.
u2 u 2 n21 n 21 n22 n 22 n2C n 2 C n2. n 2.
uR u R nR1 n R 1 nR2 n R 2 nRC n R C nR. n R .
Sums n.1 n .1 n.2 n .2 n.C n . C n..=n n . . = n

调整的兰德系数为:

ARI=RIE(RI)max(RI)E(RI) A R I = R I − E ( R I ) m a x ( R I ) − E ( R I )

ARI其实是去均值归一化的形式,RI中的a+d可以表示为 i,j(nij2) ∑ i , j ( n i j 2 )
E(RI)=E(i,j(nij2))=[i(ni.2)j(n.j2)]/(n2) E ( R I ) = E ( ∑ i , j ( n i j 2 ) ) = [ ∑ i ( n i . 2 ) ∑ j ( n . j 2 ) ] / ( n 2 )

max(RI)=12[i(ni.2)+j(n.j2)] m a x ( R I ) = 1 2 [ ∑ i ( n i . 2 ) + ∑ j ( n . j 2 ) ]

优点:
- Random (uniform) label assignments have a ARI score close to 0.0 for any value of n_clusters and n_samples (which is not the case for raw Rand index or the V-measure for instance).

  • Bounded range [-1, 1]: negative values are bad (independent labelings), similar clusterings have a positive ARI, 1.0 is the perfect match score.

  • No assumption is made on the cluster structure: can be used to compare clustering algorithms such as k-means which assumes isotropic blob shapes with results of spectral clustering algorithms which can find cluster with “folded” shapes.

缺点:

Contrary to inertia, ARI requires knowledge of the ground truth classes while is almost never available in practice or requires manual assignment by human annotators (as in the supervised learning setting).

However ARI can also be useful in a purely unsupervised setting as a building block for a Consensus Index that can be used for clustering model selection (TODO).

参考:

http://faculty.washington.edu/kayee/pca/supp.pdf

http://scikit-learn.org/stable/modules/clustering.html#adjusted-rand-index

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值