How sequentialfs select XTRAIN and XTEST for calling fun to perform for 10-fold cross-validation?
2 views (last 30 days)
Show older comments
I want to select features using sequentialfs where I used 10 for cross-validation for cvpartition. I have given the Data which is my training data (observation with feature values) and Labels which are the class labels for each observation. My code looks like the following:
Data=read from the excel file;
Labels=read from the excel file;
c=cvpartition(Labels,'KFold',10);
classf=@(Train_data, Train_labels, Test_data, Test_labels)...
sum(predict(fitcsvm(Train_data, Train_labels, 'KernenFunction', 'rbf'), Test_data) ~= Test_labels);
No_features=20;
[fs, history]=sequentialfs(classf,Data,Labels,'cv',c,'nfeatures',No_features,'direction', 'forward', 'options',opts)
But, I could not understand how the sequentialfs select the Train_data subset and Test_data subset for each fold.
It is possilbe to custom select the training and test subset for each fold.
Thanks.
0 Comments
Answers (0)
See Also
Categories
Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!