Evaluation metrics for hierarchical cluster in R

人走茶凉 提交于 2021-01-13 10:33:12

问题


I would like to know how to assess the quality of the cluster generated by the code below. It is a hierarchical cluster. I know that there are assessment measures for clusters, such as accuracy, recall, F1-measure, Rand Index, among others.

Could you help me find the values corresponding to at least two of these metrics?

Thank you so much!

library(ggplot2)
library(rdist)
library(geosphere)


df<-structure(list(Industries = c(1,2,3,4,5,6), 
                   Latitude = c(-23.8, -23.8, -23.9, -23.7, -23.7,-23.7), 
                   Longitude = c(-49.5, -49.6, -49.7, -49.8, -49.6,-49.9), 
                   Waste = c(526, 350, 526, 469, 534, 346)), class = "data.frame", row.names = c(NA, -6L))

#clusters
coordinates<-df[c("Latitude","Longitude")]
d<-as.dist(distm(coordinates[,2:1]))
fit.average<-hclust(d,method="average") 
clusters<-cutree(fit.average, k=3) 
df$cluster <- clusters 
plot(fit.average,hang=-1,cex=.8,main="Average Linkage Clustering")
rect.hclust(fit.average,k=3)

来源:https://stackoverflow.com/questions/65207873/evaluation-metrics-for-hierarchical-cluster-in-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!