christinalyy
rand index 在R中如何实现?谢谢。
Rand index
Instatistics, and in particular in data clustering, the Rand index or Randmeasure is a measure of the similarity between two data clusterings. Theadjusted-for-chance form of the Rand index is the Adjusted rand index. Apossible alternative for the Rand and Adjusted Rand index are the informationtheoretic based measures namely the Mutual Information (MI) and the AdjustedMutual Information (AMI).
christinalyy
??问题太白了吗 [s:12]
潘岚锋
不是太明白这个说法,但你可以参考 clv 包
里有些聚类评估方法,好像有类似的表达
潘岚锋
明白了,所谓rand index 就是clv 包里的rand statistic
看一下std.ext 和 clv.Rand 这两个函数
christinalyy
谢谢你,就是CLV里面的rand statistic,正在研究学习中。
另外,在R语言版块中发表了一个话题,关于层次聚类的,不知道发错地方没,也拿到这里讨论吧。
“做基于DTW距离的层次聚类
现想做层次聚类分析,但是距离换成DTW距离。
数据是a ,231×3的矩阵,
读入数据后用d<-dtwDist(a),显示d为231×231的距离矩阵,dtw包。
然后用hclust(d, method = "complete", members=NULL)聚类时出现错误
“错误于if (n < 2) stop("must have n >= 2 objects to cluster") :
变元长度为零”
1,可是我觉得n满足条件啊??疑惑
2,就是在hclust里d解释R: Hierarchical Clustering
d a dissimilarity structure as produced by dist.貌似在那里看到只能用欧几里德等几种,没有DTW,那能直接换成我求的dtwDist(a)吗?
3,在曾作成功的聚类里,貌似只从dendrogram图里看到结果,能不能把聚类结果显示在文件里了,数字的?”
潘岚锋
我这里没有问题
x <- matrix(sample(c(FALSE, TRUE), 8, rep = TRUE), ncol = 2)
hclust(dist(x, method = "DTW"))
proxy 包里的dist 函数 有DTW 方法
3.参看stats包里的identify