Efficient multiclass weighted majority voting implementation

조회 수: 4 (최근 30일)
Rashid
Rashid 2013년 3월 19일
댓글: Mona Al-Kharraz 2020년 4월 4일
Hi MATLAB Gurus,
For a few days I was wondering on how to efficiently implement weighted majority voting of m experts in matlab. Here is an example of what I want. Suppose we have 3 experts with weights vector
w=[7 2 6]
Suppose they are voting n times on the options A/B/C/D, so we for example get the following n x m voting matrix, where the columns are votes of each expert.
A B B
C A A
D B A
A A C
Now I'd like to find weighted majority vote for each row. We calculate it by adding the weights of experts which voted for each option, and selecting the maximal weight. For example, in the first row, the option A has cumulative weight of 7 (vote of expert 1) and B has cumulative weight of 8 (votes of expert 2 and 3), and hence the final vote is B. So we get the following cumulative weights matrix and final votes:
A B C D
- - - -
7 8 0 0 -> B
8 0 7 0 -> A
6 2 0 7 -> D
9 0 6 0 -> A
Now, the implementation of this using for loops over number of rows n is more or less straightforward. I am now looking for solution, which doesn't require this potentially lengthy loop. I have had a few ideas, but ran into some problems with each of them, so will not mention them now. If anyone have had similar situation before, please share your solutions.
Thanks.

채택된 답변

Rashid
Rashid 2013년 3월 19일

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by