Combining N pattern classifiers using weighted majority voting in Matlab
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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.
0 commentaires
Réponses (1)
kh rezaee
le 29 Jan 2020
Modifié(e) : kh rezaee
le 29 Jan 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.
0 commentaires
Voir également
Catégories
En savoir plus sur Statistics and Machine Learning Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!