其他分享
首页 > 其他分享> > 计算kappa系数

计算kappa系数

作者:互联网

转自:https://blog.csdn.net/u011630575/article/details/78594791

1.例子

from sklearn.metrics import cohen_kappa_score
y_true = [1,1,1]
y_pred = [2,2,2]
print(cohen_kappa_score(y_true, y_pred))

0.0

说明kappa系数的计算与label是有关系的,不像ARI和NMI计算与label无关:

NMI:

from sklearn.metrics.cluster import normalized_mutual_info_score
y_true = [1,1,1]
y_pred = [2,2,2]
print(normalized_mutual_info_score(y_true, y_pred))

1.0

ARI:

from sklearn.metrics.cluster import adjusted_rand_score
y_true = [1,1,1]
y_pred = [2,2,2]
print(adjusted_rand_score(y_true, y_pred))

1.0

 

标签:系数,kappa,pred,score,计算,print,import,true
来源: https://www.cnblogs.com/BlueBlueSea/p/15777396.html