Bonjour,
je dois réaliser un arbre de décision à l'aide des données suivantes :
http://egon86.free.fr/Vowel_Eapp.dat (ensemble d'apprentissage)
http://egon86.free.fr/Vowel_Etst.dat (ensemble de test)
Voici mon code pour la construction :
(http://egon86.free.fr/arbre_voyelles.R)
library(MASS)
library(class)
library(rpart)
Eapp <- read.table("Vowel_Eapp.dat")
Xapp <- Eapp[,-11]
yapp <- Eapp[,11]
Etst <- read.table("Vowel_Etst.dat")
Xtst <- Etst[,-11]
ytst <- Etst[,11]
data <- rbind(Xapp, Xtst)
APP = cbind(Xapp,yapp)
APP = as.data.frame(APP)
TST = cbind(Xtst,ytst)
TST = as.data.frame(TST)
ad.APP.cnt <- rpart.control (minsplit = 50)
ad.APP <- rpart (yapp ~ V1 + V2 + V3 + V4 + V5 + V6 + V7 + V8 + V9 + V10,APP, control = ad.APP.cnt)
plot (ad.APP)
text (ad.APP)
predict(ad.APP, APP)
predict(ad.APP, TST)
voici ce que j'obtiens :
Pourquoi je n'ai pas "1", "2"...., correspondant à mes 11 classes, sur les feuilles de l'arbre ?