Clear Filters
Clear Filters

A X B Cross-validation.

1 view (last 30 days)
Basheer Alwaely
Basheer Alwaely on 25 Nov 2018
How to implement A X B Cross-validation and get the confusion matrix. For example, 5 times 2-fold Cross-validation.
I used this code to implement k-fold only
mdl = fitcknn(inputs,targets);
partModel = crossval(mdl, 'KFold', 5); % 5-fold cross validation
Accuracy = 1 - kfoldLoss(partModel, 'LossFun', 'ClassifError');
[validationPredictions, ~] = kfoldPredict(partModel);
Conf_Mat=confusionmat(targets',validationPredictions);

Answers (0)

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!