Hierarchical Cluster階層クラスタリング
2206 ワード
R:Hierarchical Cluster階層クラスタリング
2年前(2014-10-05 12:05)に発表された読書(
1884)|コメント(
0)
0人はこの文章を収集して、私は収集します
いいね
0
ディレクトリ[-]
構築データ:クラスタリング:2つのクラスタに分割:参照:構築データ:
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
クラスタリング:
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2つのクラスタに分割:
?
1
2
3
参照先:
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
2年前(2014-10-05 12:05)に発表された読書(
1884)|コメント(
0)
0人はこの文章を収集して、私は収集します
いいね
0
ディレクトリ[-]
構築データ:クラスタリング:2つのクラスタに分割:参照:構築データ:
?
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)
2つのクラスタに分割:
?
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