leave one person out cross validation

조회 수: 7 (최근 30일)
pallavi patil
pallavi patil 2021년 8월 19일
답변: Prince Kumar 2021년 9월 7일
i have dataset which contains data from 10 subject. My idea fir cross validaytion is leave one person out cross validation. Here i trian on data from 9 subjects and test on data from 1. When we normally do cross validation, we have a stopping criteria which avoids model overfitting.
How do I avoid overfittiing in my case.
below is code snippet
for idx = 1:N%k = LOOCV train on rest; validate on K- meal
s = [1:idx-1 idx+1:N];
Xtrain= Training(s); %(all remaining datasets)
Xvalidate = Training(idx);% idx dataset
Xtrainlabel = Training_labels(s);
Xvalidatelabel = Training_labels(idx);
Mdl = fitcsvm(XTrain(:,featsel),...
XTrainlabel);
[trainSVM,trainScoreSVM] = resubPredict(Mdl); %training
%- Cross-validate the classifier
CVSVMModel = crossval( Mdl );
%validation
Yval_pred= predict(Mdl, XValidate(:, featsel)); %validation
[cmV,order] = confusionmat(Yval_pred, actual_val);
tnV = cmV(1,1);
fnV = cmV(1,2);
fpV = cmV(2,1);
tpV = cmV(2,2);
Accuracy(idx) = (tp+fp)./(tp+fp+tn+fn);
end
  댓글 수: 2
Wan Ji
Wan Ji 2021년 8월 20일
Use dropoutLayer may help you avoid model overfitting. Try it
pallavi patil
pallavi patil 2021년 8월 20일
i am using svm as classifier. I supoose dropoutLayer works for neural network.

댓글을 달려면 로그인하십시오.

답변 (1개)

Prince Kumar
Prince Kumar 2021년 9월 7일
You can try the following methods:
  1. Remove features
  2. Feature Selection
  3. Regularization
  4. Ensemble models if you are ok with trying models other than SVM

카테고리

Help CenterFile Exchange에서 Get Started with Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by