Neu
Neu

Reputation: 53

how to get misclassification rate in each fold of cross validation?

I am currently using this syntax in matlab to get misclassification rate in 10-fold cross validation :

target = [repmat(1,ntrial,1);repmat(2,ntrial,1)];
cvo = cvpartition(target,'k',10);
func = @(XTRAIN,ytrain,XTEST)(classify(XTEST,XTRAIN,ytrain));
mcr = crossval('mcr',pooling,target,'predfun',func,'partition',cvo);

(where 'pooling' is the 2-class feature set I'd like to classify with the classifier)

From what I read, mcr will return the average misclassification rate from 10 folds. Now if I want to get the misclassification rate from each fold, what should I do?

Thank you in advance.

Upvotes: 5

Views: 801

Answers (1)

Shai
Shai

Reputation: 114976

I would say that in this case you would like to have a bit more control over the training/validation process. Have you considered breaking down the process for more control? Start with cvpartition to create the 10-folds for cross validation and then act on each fold separately.

Upvotes: 1

Related Questions