【发布时间】:2017-08-26 00:59:22
【问题描述】:
我在 r 中使用 DTWCLUST 包。这是我的代码。
library(dtwclust)
sc1 <- read.table("D:/handling data/confirm4.csv", header=T, sep="," )
hc_sbd <- dtwclust(sc1, type = 'h', k=5L, method = 'ward.D', preproc = zscore,
distance = 'dtw', control = list(trace=TRUE) )
clusters <- cutree(hc_sbd,6)
head(clusters)
result <- cbind.data.frame(sc1,clusters)
plot(hc_sbd, type='centroids', clus=1) + ylim(-3, 3) + scale_x_continuous( breaks = c(1,6,12,18,24,30,36,42), labels= real_label )
当我运行plot(hc_sbd, type='centroids', clus=1) + ylim(-3, 3) + scale_x_continuous( breaks = c(1,6,12,18,24,30,36,42), labels= real_label ) 时,原型被绘制出来了。
但我不知道 PAM 是如何计算质心的,这是默认选项。谁能帮我理解 PAM 到 obtaion 质心的概念?
提前感谢您。
【问题讨论】:
-
我投票结束这个问题,因为它是关于算法的内部问题,而不是它的实现。
标签: r cluster-computing