if (FALSE) {
data(phoneme)
ldat <- ldata("df" = data.frame(y = phoneme[["classlearn"]]),
"x" = phoneme[["learn"]])
a1 <- classif.glm(y ~ x, data = ldat)
summary(a1)
newldat <- ldata("df" = data.frame(y = phoneme[["classtest"]]),
"x" = phoneme[["test"]])
p1 <- predict(a1,newldat)
table(newldat$df$y,p1)
sum(p1==newldat$df$y)/250
}
Run the code above in your browser using DataLab