How to do k-fold cross validation in matlab?

I am working on my face recognition project.i need to do k-fold cross validation to check my classifier accuracy.Can anybody please tell me how i can do K-fold cross validation for my data of images?

4 Comments

Can you provide some additional details about your approach? How are your images stored (e.g., is it an M-by-N-by-P array of P 2D images?)? What classifier are you using? Is it a built-in MATLAB function?
i am using matlab built in FLD based approach (fisher faces). Yes i have read images from 21 different folders and stored them in a cell array.
What Matlab version are you using? There is a classification learner app that can help you. It is a straight forward.
Hii....Iam also doing the same one now. Can you please provide your code if it is available?

Sign in to comment.

Answers (1)

I think the function crossvalind may help. Check out the example of 10-fold cross validation provided at that link.

Tags

Asked:

on 9 May 2017

Commented:

on 5 Dec 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!