if (FALSE) {
## load the Growth dataset
dataf = dataf.growth()
learn = c(head(dataf$dataf, 49), tail(dataf$dataf, 34))
labels= c(head(dataf$labels, 49), tail(dataf$labels, 34))
test = tail(head(dataf$dataf, 59), 10) # elements 50:59. 5 girls, 5 boys
#cross-validate over the whole variants up to dimension 3
c1 = ddalphaf.train (learn, labels, classifier.type = "ddalpha", maxNumIntervals = 3)
classified1 = ddalphaf.classify(c1, test)
print(unlist(classified1))
print(c1$adc.args)
# cross-validate over these two variants
c2 = ddalphaf.train (learn, labels, classifier.type = "ddalpha",
adc.args = list(
list(instance = "avr",
numFcn = 1,
numDer = 2),
list(instance = "avr",
numFcn = 0,
numDer = 2)))
classified2 = ddalphaf.classify(c2, test)
print(unlist(classified2))
print(c2$adc.args)
}
Run the code above in your browser using DataLab