if (FALSE) {
data(phoneme)
ldat <- ldata("df" = data.frame(y = phoneme[["classlearn"]]),
"x" = phoneme[["learn"]])
classifKgroups <- fda.usc:::classifKgroups
a1 <- classif.gsam( y ~ s(x,k=3),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