wiki:Classification hierarchique

Classification hierarchique

back to first page ..

see http://pbil.univ-lyon1.fr/R/stage/stage7.pdf
http://cran.r-project.org/web/views/Cluster.html

  • library(ade4)
  • dist.binary() # mesure tous les types de distance voir ade4classifiacation stage7.pdf p7 pour des données binaires
  • s.corcircle(dudi.pca(data)$co) cercle des correlations
  • dudi.pca analyse en composantes principales
  • dudi.pca performs a principal component analysis of a data frame and returns the results as objects of class pca and dudi
  • pairs(data) {graphics} A matrix of scatterplots is produced.
  • s.arrow {ade4} Plot of the factorial maps for the projection of a vector basis
  • s.label {ade4} Scatter Plot
  • s.class {ade4} performs the scatter diagrams with representation of point classes.
  • dist.quant computes on quantitative variables, some distance matrices as canonical, Joreskog and Mahalanobis
  • scatter {ade4} fonction générique avec des méthodes pour les classes coa, dudi, fca, acm and pco see ? Scatter
  • is.euclid(distance) La distance est-elle euclidienne ?
  • scalewt transforms a numeric matrix in a centred and scaled matrix for any weighting.
  • scatterutil {ade4} utility functions for adE4
  • scatterutil.legendgris utility for legend
  • s<-scale(data, center = TRUE, scale = TRUE) #Centrage et réduction des données
  • d<-dist(s, method ="euclidean", diag=FALSE, upper=FALSE) #Calcul du tableau des distances (mehtod= euclidian, maximum, manhattan, canberra, binary, minkowski)

http://geai.univ-brest.fr/~carpenti/2004-2005/PSRS83B-4.pdf

  • h<-hclust(d,"ward") #classification
  • plot(h,hang=-1)
  • cutree(h,nbclass)

http://rstat.ouvaton.org/?article10/classification-hierarchique

#Les données
library(ade4)
data(olympic)
olympic$tab
#Centrage et réduction des données
don<-scale(olympic$tab, center = TRUE, scale = TRUE)
#Calcul du tableau des distances
dc<-dist(don, method ="euclidean", diag=FALSE, upper=FALSE)
#la classification
hier<-hclust(dc,"ward")
plot(hier,hang=-1)
#Récupération des groupes (4 classes)
cl4<-cutree(hier,4)
#Illustration des classes sur le plan d'ACP
z<- princomp(as.matrix(don),cor=TRUE)

#l'éboulis des valeurs propres
plot(z,main="Les valeurs propres\nIllustration de la
hiérarchie")
#représentation graphique du plan principal
biplot(z,xlabs=cl4,xlim=c(-0.4,.5),main="Performances
olympiques")
abline(v=0,h=0)
#les moyennes par classe
doncl<-merge(olympic$tab, cl4,by= "row.names")
moyennes<-aggregate(doncl[,-1], list(doncl$y), mean)
moyennes[2:11]<-round(moyennes[2:11],2)
moyennes[,-12]
#une autre représentation
library(cluster)
clusplot(dc,cl4,diss=T,shade=T,color=T,labels=4,main="")
abline(v=0,h=0)

See also in Collinearity

Last modified 14 years ago Last modified on Apr 14, 2011 10:42:05 AM