qda in MASS package library(MASS) fit<-qda(Species~. , data=iris, CV=T) fit 2<-qda(Species~. , data=iris, CV=T, method="mle") ct<-table(iris$Species, fit 2$class) diag(prop. table(ct, 1)) sum(diag(prop. table(ct))) library(kla. R) partimat(Species~. , data=iris, method="qda") Xuhua Xia Slide 4
Slide 5
Cross-validation • Holdout method with jackknifing • K-fold cross validation: Divide data in each category into K sets. Each set will be used a test set and the rest will be pooled as training data. Every data point gets to be in a test set exactly once, and gets to be in a training set k-1 times. • Leave-one-out cross validation: K-fold cross validation taken to its extreme, with K equal to N, the number of data points in the set. Xuhua Xia Slide 6