Combining N pattern classifiers using weighted majority voting in Matlab
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
kh rezaee
2020-1-29
编辑:kh rezaee
2020-1-29
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!