日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) >

Hierarchical Cluster 层次聚类

發(fā)布時(shí)間:2025/7/25 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Hierarchical Cluster 层次聚类 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

R: Hierarchical Cluster 層次聚類

發(fā)表于2年前(2014-10-05 12:05)?? 閱讀(1884)?|?評(píng)論(0)?0人收藏此文章,?我要收藏 0

目錄[-]

  • 構(gòu)造數(shù)據(jù):
  • 聚類:
  • 分成兩個(gè)簇:
  • 參考:

構(gòu)造數(shù)據(jù):

?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 > dataset = matrix(c(1,2, + 1.2,2, + 8,9, + 0.9,1.8, + 7,10, + 8.8,9.2), nrow=6, byrow=T) > dataset ?????[,1] [,2] [1,]? 1.0? 2.0 [2,]? 1.2? 2.0 [3,]? 8.0? 9.0 [4,]? 0.9? 1.8 [5,]? 7.0 10.0 [6,]? 8.8? 9.2


聚類:

?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 > d = dist(dataset) > d ???????????1????????? 2????????? 3????????? 4????????? 5 2? 0.2000000??????????????????????????????????????????? 3? 9.8994949? 9.7590983???????????????????????????????? 4? 0.2236068? 0.3605551 10.1118742????????????????????? 5 10.0000000? 9.8812955? 1.4142136 10.2200783?????????? 6 10.6150836 10.4690019? 0.8246211 10.8245092? 1.9697716 > hclust(d, method = "complete") Call: hclust(d = d, method = "complete") Cluster method?? : complete Distance???????? : euclidean Number of objects: 6 > hc = hclust(d, method = "complete") > plot(hc)




分成兩個(gè)簇:

?
1 2 3 > democut<-cutree(hc,k=2) > democut [1] 1 1 2 1 2 2

參考:

http://www.r-tutor.com/gpu-computing/clustering/hierarchical-cluster-analysis
http://stat.ethz.ch/R-manual/R-devel/library/stats/html/hclust.html
http://ecology.msu.montana.edu/labdsv/R/labs/lab13/lab13.html

總結(jié)

以上是生活随笔為你收集整理的Hierarchical Cluster 层次聚类的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。