SlideShare una empresa de Scribd logo
1 de 7
R:

    (          )



sesejun@is.ocha.ac.jp
     2009/12/10
k-means
> usps<-read.table("usps/usps_cluster.csv", header=T, sep=",")
> usps.sub<-usps[3:length(usps)]



> rownames(usps.sub)<-usps$ImageName



> usps.kmeans<-kmeans(usps.sub, 3, iter.max=100)
> usps.kmeans$size
[1] 5 2 3
> usps.kmeans$cluster
 [1] 2 3 3 1 1 2 3 1 1 1


> usps.kmeans
> usps.dist<-dist(usps.sub, method="euclidean")


> usps.dist
              img_0_00_00 img_1_00_00 img_2_00_00 img_3_00_00
img_1_00_00      2517.392
img_2_00_00      2172.201    2204.662
img_3_00_00      2073.739    2128.806    2225.389
img_4_00_00      2239.165    1915.576    2220.492    1928.101
img_5_00_00      1981.039    2472.299    2179.280    2400.684
...
> usps.hclust<-hclust(usps.dist,method="single")
> plot(usps.hclust)
Datamining R 5th
> library(cluster)
> usps.div<-diana(usps.sub, metric="euclidian",stand=TRUE)


> print(usps.div)
Merge:
       [,1] [,2]
 [1,]    -8 -10
 [2,]    -2   -7
 [3,]    -4   -5
 [4,]     1   -9
...

> plot(usps.div)

                    <Return>            :
                    <Return>            :
Datamining R 5th
1. k-means          usps_cluster_large.tab           k
                                         k 5

     •   usps_cluster_large.tab       0        9           5   50

2.                                                 DIANA
     usps_cluster_large.tab




     •   1,2

3.

•              1   29

Más contenido relacionado

Destacado

PRE: Datamining 2nd R
PRE: Datamining 2nd RPRE: Datamining 2nd R
PRE: Datamining 2nd Rsesejun
 
Ohp Seijoen H20 05 Hairetsu
Ohp Seijoen H20 05 HairetsuOhp Seijoen H20 05 Hairetsu
Ohp Seijoen H20 05 Hairetsusesejun
 
Elegance Freguesia - Comercialização: 55 (21) 99219-0640 WhatsApp ou (21) 781...
Elegance Freguesia - Comercialização: 55 (21) 99219-0640 WhatsApp ou (21) 781...Elegance Freguesia - Comercialização: 55 (21) 99219-0640 WhatsApp ou (21) 781...
Elegance Freguesia - Comercialização: 55 (21) 99219-0640 WhatsApp ou (21) 781...Marcelo Silva
 
Connect Life - Work - Trade - Taquara - Comercialização: 55 (21) 99219-0640...
Connect  Life - Work - Trade - Taquara  - Comercialização: 55 (21) 99219-0640...Connect  Life - Work - Trade - Taquara  - Comercialização: 55 (21) 99219-0640...
Connect Life - Work - Trade - Taquara - Comercialização: 55 (21) 99219-0640...Marcelo Silva
 
Sql Server Analysis Server SSAS OLAP Integration Office 365
Sql Server Analysis Server SSAS OLAP Integration Office 365Sql Server Analysis Server SSAS OLAP Integration Office 365
Sql Server Analysis Server SSAS OLAP Integration Office 365Layer2
 
To a wild rose - Edward Mac Dowell
To a wild rose -  Edward Mac DowellTo a wild rose -  Edward Mac Dowell
To a wild rose - Edward Mac Dowelldavid bonnin
 

Destacado (8)

PRE: Datamining 2nd R
PRE: Datamining 2nd RPRE: Datamining 2nd R
PRE: Datamining 2nd R
 
Ohp Seijoen H20 05 Hairetsu
Ohp Seijoen H20 05 HairetsuOhp Seijoen H20 05 Hairetsu
Ohp Seijoen H20 05 Hairetsu
 
Plezier 2
Plezier 2Plezier 2
Plezier 2
 
Elegance Freguesia - Comercialização: 55 (21) 99219-0640 WhatsApp ou (21) 781...
Elegance Freguesia - Comercialização: 55 (21) 99219-0640 WhatsApp ou (21) 781...Elegance Freguesia - Comercialização: 55 (21) 99219-0640 WhatsApp ou (21) 781...
Elegance Freguesia - Comercialização: 55 (21) 99219-0640 WhatsApp ou (21) 781...
 
Connect Life - Work - Trade - Taquara - Comercialização: 55 (21) 99219-0640...
Connect  Life - Work - Trade - Taquara  - Comercialização: 55 (21) 99219-0640...Connect  Life - Work - Trade - Taquara  - Comercialização: 55 (21) 99219-0640...
Connect Life - Work - Trade - Taquara - Comercialização: 55 (21) 99219-0640...
 
Sql Server Analysis Server SSAS OLAP Integration Office 365
Sql Server Analysis Server SSAS OLAP Integration Office 365Sql Server Analysis Server SSAS OLAP Integration Office 365
Sql Server Analysis Server SSAS OLAP Integration Office 365
 
Resultados del proyecto Valencia SmartCity y retos en el ámbito de la seguridad
Resultados del proyecto Valencia SmartCity y retos en el ámbito de la seguridadResultados del proyecto Valencia SmartCity y retos en el ámbito de la seguridad
Resultados del proyecto Valencia SmartCity y retos en el ámbito de la seguridad
 
To a wild rose - Edward Mac Dowell
To a wild rose -  Edward Mac DowellTo a wild rose -  Edward Mac Dowell
To a wild rose - Edward Mac Dowell
 

Más de sesejun

RNAseqによる変動遺伝子抽出の統計: A Review
RNAseqによる変動遺伝子抽出の統計: A ReviewRNAseqによる変動遺伝子抽出の統計: A Review
RNAseqによる変動遺伝子抽出の統計: A Reviewsesejun
 
バイオインフォマティクスによる遺伝子発現解析
バイオインフォマティクスによる遺伝子発現解析バイオインフォマティクスによる遺伝子発現解析
バイオインフォマティクスによる遺伝子発現解析sesejun
 
次世代シーケンサが求める機械学習
次世代シーケンサが求める機械学習次世代シーケンサが求める機械学習
次世代シーケンサが求める機械学習sesejun
 
20110602labseminar pub
20110602labseminar pub20110602labseminar pub
20110602labseminar pubsesejun
 
20110524zurichngs 2nd pub
20110524zurichngs 2nd pub20110524zurichngs 2nd pub
20110524zurichngs 2nd pubsesejun
 
20110524zurichngs 1st pub
20110524zurichngs 1st pub20110524zurichngs 1st pub
20110524zurichngs 1st pubsesejun
 
20110214nips2010 read
20110214nips2010 read20110214nips2010 read
20110214nips2010 readsesejun
 
Datamining 9th association_rule.key
Datamining 9th association_rule.keyDatamining 9th association_rule.key
Datamining 9th association_rule.keysesejun
 
Datamining 8th hclustering
Datamining 8th hclusteringDatamining 8th hclustering
Datamining 8th hclusteringsesejun
 
Datamining r 4th
Datamining r 4thDatamining r 4th
Datamining r 4thsesejun
 
Datamining r 3rd
Datamining r 3rdDatamining r 3rd
Datamining r 3rdsesejun
 
Datamining r 2nd
Datamining r 2ndDatamining r 2nd
Datamining r 2ndsesejun
 
Datamining r 1st
Datamining r 1stDatamining r 1st
Datamining r 1stsesejun
 
Datamining 6th svm
Datamining 6th svmDatamining 6th svm
Datamining 6th svmsesejun
 
Datamining 5th knn
Datamining 5th knnDatamining 5th knn
Datamining 5th knnsesejun
 
Datamining 4th adaboost
Datamining 4th adaboostDatamining 4th adaboost
Datamining 4th adaboostsesejun
 
Datamining 3rd naivebayes
Datamining 3rd naivebayesDatamining 3rd naivebayes
Datamining 3rd naivebayessesejun
 
Datamining 2nd decisiontree
Datamining 2nd decisiontreeDatamining 2nd decisiontree
Datamining 2nd decisiontreesesejun
 
Datamining 7th kmeans
Datamining 7th kmeansDatamining 7th kmeans
Datamining 7th kmeanssesejun
 
100401 Bioinfoinfra
100401 Bioinfoinfra100401 Bioinfoinfra
100401 Bioinfoinfrasesejun
 

Más de sesejun (20)

RNAseqによる変動遺伝子抽出の統計: A Review
RNAseqによる変動遺伝子抽出の統計: A ReviewRNAseqによる変動遺伝子抽出の統計: A Review
RNAseqによる変動遺伝子抽出の統計: A Review
 
バイオインフォマティクスによる遺伝子発現解析
バイオインフォマティクスによる遺伝子発現解析バイオインフォマティクスによる遺伝子発現解析
バイオインフォマティクスによる遺伝子発現解析
 
次世代シーケンサが求める機械学習
次世代シーケンサが求める機械学習次世代シーケンサが求める機械学習
次世代シーケンサが求める機械学習
 
20110602labseminar pub
20110602labseminar pub20110602labseminar pub
20110602labseminar pub
 
20110524zurichngs 2nd pub
20110524zurichngs 2nd pub20110524zurichngs 2nd pub
20110524zurichngs 2nd pub
 
20110524zurichngs 1st pub
20110524zurichngs 1st pub20110524zurichngs 1st pub
20110524zurichngs 1st pub
 
20110214nips2010 read
20110214nips2010 read20110214nips2010 read
20110214nips2010 read
 
Datamining 9th association_rule.key
Datamining 9th association_rule.keyDatamining 9th association_rule.key
Datamining 9th association_rule.key
 
Datamining 8th hclustering
Datamining 8th hclusteringDatamining 8th hclustering
Datamining 8th hclustering
 
Datamining r 4th
Datamining r 4thDatamining r 4th
Datamining r 4th
 
Datamining r 3rd
Datamining r 3rdDatamining r 3rd
Datamining r 3rd
 
Datamining r 2nd
Datamining r 2ndDatamining r 2nd
Datamining r 2nd
 
Datamining r 1st
Datamining r 1stDatamining r 1st
Datamining r 1st
 
Datamining 6th svm
Datamining 6th svmDatamining 6th svm
Datamining 6th svm
 
Datamining 5th knn
Datamining 5th knnDatamining 5th knn
Datamining 5th knn
 
Datamining 4th adaboost
Datamining 4th adaboostDatamining 4th adaboost
Datamining 4th adaboost
 
Datamining 3rd naivebayes
Datamining 3rd naivebayesDatamining 3rd naivebayes
Datamining 3rd naivebayes
 
Datamining 2nd decisiontree
Datamining 2nd decisiontreeDatamining 2nd decisiontree
Datamining 2nd decisiontree
 
Datamining 7th kmeans
Datamining 7th kmeansDatamining 7th kmeans
Datamining 7th kmeans
 
100401 Bioinfoinfra
100401 Bioinfoinfra100401 Bioinfoinfra
100401 Bioinfoinfra
 

Datamining R 5th

  • 1. R: ( ) sesejun@is.ocha.ac.jp 2009/12/10
  • 2. k-means > usps<-read.table("usps/usps_cluster.csv", header=T, sep=",") > usps.sub<-usps[3:length(usps)] > rownames(usps.sub)<-usps$ImageName > usps.kmeans<-kmeans(usps.sub, 3, iter.max=100) > usps.kmeans$size [1] 5 2 3 > usps.kmeans$cluster [1] 2 3 3 1 1 2 3 1 1 1 > usps.kmeans
  • 3. > usps.dist<-dist(usps.sub, method="euclidean") > usps.dist img_0_00_00 img_1_00_00 img_2_00_00 img_3_00_00 img_1_00_00 2517.392 img_2_00_00 2172.201 2204.662 img_3_00_00 2073.739 2128.806 2225.389 img_4_00_00 2239.165 1915.576 2220.492 1928.101 img_5_00_00 1981.039 2472.299 2179.280 2400.684 ... > usps.hclust<-hclust(usps.dist,method="single") > plot(usps.hclust)
  • 5. > library(cluster) > usps.div<-diana(usps.sub, metric="euclidian",stand=TRUE) > print(usps.div) Merge: [,1] [,2] [1,] -8 -10 [2,] -2 -7 [3,] -4 -5 [4,] 1 -9 ... > plot(usps.div) <Return> : <Return> :
  • 7. 1. k-means usps_cluster_large.tab k k 5 • usps_cluster_large.tab 0 9 5 50 2. DIANA usps_cluster_large.tab • 1,2 3. • 1 29