Leaving one out is not supported in the Learner app because it may have significant runtime, but it is supported in the programmatic version of crossval, just pass it 'leaveout',1, see doc on using crossval.
Classification learner APP, why is there no leave one out option?
3 views (last 30 days)
Show older comments
Pierre Lonfat
on 11 Apr 2018
Answered: Bernhard Suhm
on 22 Apr 2018
Dear machine learning experts,
I am using the classification learner APP to easily run all algorithms at the same time.
First you have to choose if you want to do Holdout or k-fold but there is no option for leave one out (max number of k-fold = to 50 if I remember correctly).
So, what I have been doing is the following, please tell me if it makes sens:
I selected k-fold (with 5 k, whatever no importance), then I exported the code from the APP and replaced k by the number of line in my training data.
% Perform cross-validation
%rng('default');
partitionedModel = crossval(trainedClassifier.ClassificationEnsemble, 'KFold', machine.K_fold);
% Compute validation predictions
[validationPredictions, validationScores] = kfoldPredict(partitionedModel);
% Compute validation accuracy
validationAccuracy = 1 - kfoldLoss(partitionedModel, 'LossFun', 'ClassifError');
machine.K_fold being now equal not to 5 anymore but to the number of line present in my training data.
Does it do the job correctly ?
Many thanks in advance,
Pierre
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Classification Learner App 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!