Combining N pattern classifiers using weighted majority voting in Matlab

1 visualizzazione (ultimi 30 giorni)
I want to combine some classifiers. The number of classifiers is 4 and there are 3 possible classes. I came a cross this code: "Efficient multiclass weighted majority voting implementation in MATLAB". It makes use of 3 classifiers and 3 possible classes. I have tried to customize it for use with 4 classifiers and 3 possible classes without success. How can this code be extended for use in my case, or to N classifiers. Or is there any other code applicable to my case. Please help.

Risposte (1)

kh rezaee
kh rezaee il 29 Gen 2020
Modificato: kh rezaee il 29 Gen 2020
I think that your problem is near this code:
voteWeightsSUM = sum(voteWeights);
W = voteWeights/(voteWeightsSUM);
outPut = (testPredictions(:,1)*W(1)+testPredictions(:,2)*W(2)+testPredictions(:,3)*W(3)+testPredictions(:,4)*W(4));
VotingConfusionMatrix = confusionmat(TestLabel,outPut);
softVotingAccuracy = sum(diag(VotingConfusionMatrix))/sum(VotingConfusionMatrix(:));
Where, voteWeights and testPredictions are accuracy and predicted test labels of each classifier, respectively. Also, voteWeights comes from the training phase, but testPredictions is calculated based on trained models.

Categorie

Scopri di più su Statistics and Machine Learning Toolbox in Help Center e File Exchange

Tag

Non è stata ancora inserito alcun tag.

Community Treasure Hunt

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

Start Hunting!

Translated by