nmi_score的输入参数
时间: 2023-11-12 07:09:15 浏览: 51
NMI.rar_nmi_复杂网络 NMI
nmi_score的输入参数是两个聚类结果的标签(label),格式为列表(list)或数组(array)。例如:
```python
from sklearn.metrics import normalized_mutual_info_score
label_true = [0, 0, 1, 1, 2, 2] # 真实聚类结果的标签
label_pred = [0, 0, 1, 1, 1, 2] # 预测聚类结果的标签
nmi_score = normalized_mutual_info_score(label_true, label_pred)
print(nmi_score)
```
输出结果为:
```python
0.8554199500596149
```
阅读全文