在下面的 kmeans 分析中,我分配 1 或 0 来指示单词是否与用户相关联:
cells = c(1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,1,1,1,1,1)
rnames = c("a1","a2","a3","a4","a5","a6","a7","a8","a9")
cnames = c("google","so","test")
x <- matrix(cells, nrow=9, ncol=3, byrow=TRUE, dimnames=list(rnames, cnames))
# run K-Means
km <- kmeans(x, 3, 15)
# print components of km
print(km)
# plot clusters
plot(x, col = km$cluster)
# plot centers
points(km$centers, col = 1:2, pch = 8)
这是图表:
为什么我没有在每个集群周围收到多个积分?这张图说明了什么。我想根据另一个用户是否配置了相同的词来向用户建议一个词。