Problème sur un titre de dendrogramme

Postez ici vos questions, réponses, commentaires ou suggestions - Les sujets seront ultérieurement répartis dans les archives par les modérateurs

Modérateur : Groupe des modérateurs

Thierry Gautrot
Messages : 89
Enregistré le : 28 Mai 2009, 18:41

Problème sur un titre de dendrogramme

Messagepar Thierry Gautrot » 26 Oct 2014, 19:18

Bonjour,

Sur mon dendrogramme, il reste sous le titre la mention " hclust (*, "complete") et je ne sais pas comment la supprimer ?
(j'ai utilisé la fonction rest.hclust).
Merci
Thierry
    > read.table("cla88.txt")
    denv denm denc ouve
    1 244 3 7 9
    2 252 4 5 9
    3 216 4 6 9
    4 285 3 6 9
    5 264 3 4 9
    6 281 5 2 77
    7 274 2 4 77
    8 268 1 6 77
    9 528 12 22 9
    10 642 25 23 9
    11 295 2 1 9
    12 198 2 5 9
    13 185 4 2 18
    14 175 2 2 18
    15 144 1 2 18
    16 199 1 2 18
    17 201 5 3 9
    18 210 6 3 9
    19 222 7 4 9
    20 224 6 6 9
    > t8<-read.table("cla88.txt")
    > attach(t8)
    The following objects are masked from t8 (pos = 3):

    denc, denm, denv, ouve

    > t8
    denv denm denc ouve
    1 244 3 7 9
    2 252 4 5 9
    3 216 4 6 9
    4 285 3 6 9
    5 264 3 4 9
    6 281 5 2 77
    7 274 2 4 77
    8 268 1 6 77
    9 528 12 22 9
    10 642 25 23 9
    11 295 2 1 9
    12 198 2 5 9
    13 185 4 2 18
    14 175 2 2 18
    15 144 1 2 18
    16 199 1 2 18
    17 201 5 3 9
    18 210 6 3 9
    19 222 7 4 9
    20 224 6 6 9
    > summary(t8)
    denv denm denc ouve
    Min. :144.0 Min. : 1.00 Min. : 1.00 Min. : 9
    1st Qu.:200.5 1st Qu.: 2.00 1st Qu.: 2.00 1st Qu.: 9
    Median :234.0 Median : 3.50 Median : 4.00 Median : 9
    Mean :265.4 Mean : 4.90 Mean : 5.75 Mean :21
    3rd Qu.:275.8 3rd Qu.: 5.25 3rd Qu.: 6.00 3rd Qu.:18
    Max. :642.0 Max. :25.00 Max. :23.00 Max. :77
    > pa<-rpart(formula = ouve ~ ., data = t8, control = rpart.control(minsplit = 6))
    > summary(pa)
    Call:
    rpart(formula = ouve ~ ., data = t8, control = rpart.control(minsplit = 6))
    n= 20

    CP nsplit rel error xerror xstd
    1 0.49008891 0 1.00000000 1.184964 0.5079203
    2 0.01982217 2 0.01982217 2.031964 0.6564241
    3 0.01000000 3 0.00000000 1.842503 0.6353454

    Variable importance
    denv denc denm
    60 20 20

    Node number 1: 20 observations, complexity param=0.4900889
    mean=21, MSE=565.8
    left son=2 (13 obs) right son=3 (7 obs)
    Primary splits:
    denv < 266 to the left, improve=0.27967790, (0 missing)
    denm < 2.5 to the right, improve=0.12121320, (0 missing)
    denc < 6.5 to the right, improve=0.04491298, (0 missing)
    Surrogate splits:
    denm < 9.5 to the left, agree=0.75, adj=0.286, (0 split)
    denc < 14.5 to the left, agree=0.75, adj=0.286, (0 split)

    Node number 2: 13 observations, complexity param=0.01982217
    mean=11.76923, MSE=17.25444
    left son=4 (9 obs) right son=5 (4 obs)
    Primary splits:
    denc < 2.5 to the right, improve=1.0000000, (0 missing)
    denv < 200 to the right, improve=0.7111111, (0 missing)
    denm < 1.5 to the right, improve=0.4090909, (0 missing)
    Surrogate splits:
    denv < 191.5 to the right, agree=0.923, adj=0.75, (0 split)
    denm < 1.5 to the right, agree=0.846, adj=0.50, (0 split)

    Node number 3: 7 observations, complexity param=0.4900889
    mean=38.14286, MSE=1132.408
    left son=6 (4 obs) right son=7 (3 obs)
    Primary splits:
    denv < 283 to the right, improve=1.0, (0 missing)
    denm < 8.5 to the right, improve=0.3, (0 missing)
    denc < 14 to the right, improve=0.3, (0 missing)
    Surrogate splits:
    denm < 2.5 to the right, agree=0.714, adj=0.333, (0 split)
    denc < 5 to the right, agree=0.714, adj=0.333, (0 split)

    Node number 4: 9 observations
    mean=9, MSE=0

    Node number 5: 4 observations
    mean=18, MSE=0

    Node number 6: 4 observations
    mean=9, MSE=0

    Node number 7: 3 observations
    mean=77, MSE=0

    > plot(pa, uniform=TRUE)
    > text(pa)
    > library(stats)
    > hc<-hclust(dist(t8)
    + )
    > hc<-hclust(dist(t8))
    > plot(hc)
    > hc$order
    [1] 9 10 6 7 8 4 11 5 1 2 16 12 17 19 20 3 18 15 13 14
    > rect.hclust(hc,k5,border="red",which=c(1,2,3,4))
    Erreur dans rect.hclust(hc, k5, border = "red", which = c(1, 2, 3, 4)) :
    objet 'k5' introuvable
    > rect.hclust(hc,k52,border="red",which=c(1,2))
    Erreur dans rect.hclust(hc, k52, border = "red", which = c(1, 2)) :
    objet 'k52' introuvable
    > rect.hclust(hc,k2,border="red",which=c(1,2))
    Erreur dans rect.hclust(hc, k2, border = "red", which = c(1, 2)) :
    objet 'k2' introuvable
    > rect.hclust(hc,k=5,border="red",which=c(1,2,3,4))
    > rect.hclust(hc,k=5,border="red",which=c(1,2,3,4,5))
    > save.image("G:\\Test 8\\TestsPartyRpart_ok.RData")
    > plot(hc, main="Dendrogramme Test sur JDD partiel Marion")
    > plot(hc, main="Dendrogramme sur JDD de Marion",xlab=" Sites", ylab="Hauteur")
    > rect.hclust(hc,k=5,border="red",which=c(1,2,3,4,5))
    > save.image("G:\\Test 8\\TestsPartyRpart_Ok2.RData")
    >

Renaud Lancelot
Messages : 2484
Enregistré le : 16 Déc 2004, 08:01
Contact :

Messagepar Renaud Lancelot » 26 Oct 2014, 21:45

Ce libellé est contrôlé par l'argument sub de la fct plot:

Code : Tout sélectionner

v <- runif(1000)
m <- matrix(v, ncol=10)
d <- dist(m)
h <- hclust(d)
plot(h, sub = "")
Renaud

Thierry Gautrot
Messages : 89
Enregistré le : 28 Mai 2009, 18:41

Messagepar Thierry Gautrot » 27 Oct 2014, 17:21

Merci !


Retourner vers « Questions en cours »

Qui est en ligne

Utilisateurs parcourant ce forum : Google [Bot] et 1 invité