library(MASS)
library(DAAG)
ldahat <- lda(species ~ length+breadth, data=cuckoos, CV=TRUE)$posterior
qdahat <- qda(species ~ length+breadth, data=cuckoos, CV=TRUE)$posterior
rfhat <- predict(randomForest(species ~ length+breadth, data=cuckoos),
type="prob")
compareModels(groups=cuckoos$species, estprobs=list(lda=ldahat,
qda=qdahat, rf=rfhat), robust=FALSE)
Run the code above in your browser using DataLab