sklearn聚类模型评估代码_sklearn聚类算法评估方法 之各种系数

本文介绍了Python中用于聚类模型评估的多种指标,如Adjusted Rand Index、Mutual Information、Homogeneity、Completeness、V-measure、Fowlkes-Mallows Score和Silhouette Coefficient。特别强调了Calinski-Harabaz Index在无法获取真实标签时作为评估指标的优势,以及其计算速度快的特点。
摘要由CSDN通过智能技术生成

python中的分群质量

主要参考来自官方文档:Clustering

部分内容来源于:机器学习评价指标大汇总

个人比较偏好的三个指标有:Calinski-Harabaz Index(未知真实index的模型评估)、Homogeneity, completeness and V-measure(聚类数量情况)、轮廓系数

1.1 Adjusted Rand index 调整兰德系数

>>>from sklearn import metrics

>>>labels_true = [0, 0, 0, 1, 1, 1]

>>>labels_pred = [0, 0, 1, 1, 2, 2]

>>>metrics.adjusted_rand_score(labels_true, labels_pred)

0.24

.

1.2 Mutual Information based scores 互信息

Two different normalized versions of this measure are available, Normalized Mutual Information(NMI) and Adjusted Mutual Information(AMI). NMI is often used in the literature while AMI was proposed more recently and is normalized against chance:

>>>from sklearn import metrics

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值