# WIRE: A Weighted Item Removal Method for Unsupervised Rank Aggregation
## 4 WIRE: Algorithm Design and Analysis
3:\(W\leftarrow\text{sort}\big{(}w^{(u_{1})},\ldots,w^{(u_{n})}\big{)}\)\(\triangleright\)Sort the ranker weights
4:\(b,i\gets 1\)
5:while\(b<B\)do\(\triangleright\)Compute the confidence scores of all buckets
6:\(C_{b}\leftarrow\delta_{1}+(1-\delta_{1})\exp(-(b-1)B/n)\)\(\triangleright\)Equation (6)
7:\(b\gets b+1\)
8:BucketCount \(\gets 1\)
9:while\(i\leq n\)do\(\triangleright\)Group the rankers into the buckets
10:if\(i>n\cdot\text{BucketCount}/B\)then
11:BucketCount \(\leftarrow\)BucketCount\(+1\)
12:\(b^{(u_{i})}\leftarrow\text{BucketCount}\)\(\triangleright\)Place the ranker \(u_{i}\) in \(b^{(u_{i})}\)
13:\(C_{g_{(u_{i})}}\leftarrow C_{\text{BucketCount}}\)\(\triangleright\)\(u_{i}\) inherits the confidence score of its bucket \(b^{(u_{i})}\)
14:\(i\gets i+1\)
15:for each element \(\mathbf{e}\in\mathcal{L}\)do\(\triangleright\)Compute the preservation scores of all elements of \(\mathcal{L}\)
16:\(P_{\mathbf{e}}\gets 0\), \(i\gets 1\)
17:while\(i<n\)do\(\triangleright\)Sum the confidence scores of all rankers who preferred \(\mathbf{e}\)
18:if\(\mathbf{e}\in l^{(u_{i})}\)then
19:\(P_{\mathbf{e}}\gets P_{\mathbf{e}}+C_{b^{(u_{i})}}\)\(\triangleright\)Preservation score, Equation (7)
20:\(i\gets i+1\)
21:\(i\gets 1\)
22:while\(i\leq n\)do\(\triangleright\)Remove the elements with the lowest preservation scores from each list
23:\(R^{(u_{i})}_{b}\leftarrow\Big{[}|l^{(u_{i})}|C_{b^{(u_{i})}}\Big{]}\)\(\triangleright\)Protection score, Equation (8)
24:\(H\leftarrow\text{BuildMinHeap}\big{(}l^{(u_{i})}\big{)}\)\(\triangleright\)Build a min heap from the elements of the list
25:RemovedElements \(\leftarrow\) 0
26:whileRemovedElements \(<|l^{(u_{i})}|-R^{(u_{i})}_{b}\)do\(\triangleright\)Remove \(|l^{(u_{i})}|-R^{(u_{i})}_{b}\) elements
27:\(\mathbf{e}\gets H.\text{pop}()\)\(\triangleright\)Pop the heap's head \(\mathbf{e}\)
28:\(l^{(u_{i})}\gets l^{(u_{i})}-\mathbf{e}\)\(\triangleright\)Remove \(\mathbf{e}\)
29:RemovedElements \(\leftarrow\)RemovedElements \(+1\)
30:\(i\gets i+1\)
31:\(\mathcal{L}^{\prime}\leftarrow\mathcal{A}_{\text{av}}\Big{(}l^{(u_{1})}, \ldots,l^{(u_{n})}\Big{)}\)\(\triangleright\)Rerun the weighted aggregator \(\mathcal{A}_{\text{av}}\) on the new lists
32:return\(\mathcal{L}^{\prime}\)
```  
**Algorithm 1** WIRE: Weighted Item RemovalInitially, the rankers are sorted in decreasing weight order. Then, they are distributed into a set of \(B<n\) equally sized buckets in such a manner that each bucket contains \(n/B\) rankers. Since the ranker weights are sorted in descending order, the first bucket will contain the expert rankers, that is, those who received the \(n/B\) highest weights; the second bucket will include the rankers with lower weights, and so on. We now introduce an exponentially decaying _confidence score_ for each bucket \(b\in B\) as follows:  
\[C_{b}=\delta_{1}+(1-\delta_{1})\exp(-(b-1)B/n), \tag{6}\]  
where \(\delta_{1}\in[0,1]\) is a hyper-parameter that specifies the minimum confidence score of a bucket. The confidence scores of Equation (6) are inherited by all rankers belonging to a particular bucket, as shown in step 11 of Algorithm 1. Therefore, the rankers of the first bucket (\(b=1\)) receive a confidence score \(C_{1}=1\), regardless of the total number of buckets \(B\). Similarly, all rankers in the second bucket (\(b=2\)) are assigned a confidence score \(S_{2}=\delta_{1}+(1-\delta_{1})\exp(-B/n))\), etc. Notice that \(C_{b}\in[0,1]\). Subsequently, for each element \(\mathbf{e}\in\mathcal{L}\) we introduce the following _preservation score_:  
\[P_{\mathbf{e}}=\sum_{\forall u\mid\mathbf{e}\in I(u)}C_{b^{(u)}}=\sum_{ \forall u\mid\mathbf{e}\in I(u)}\Big{(}\delta_{1}+(1-\delta_{1})\exp\big{(}-( b^{(u)}-1)B/n\big{)}\Big{)}, \tag{7}\]  
where \(b^{(u)}\) denotes the bucket in which the ranker \(u\) has been placed. Equation (7) indicates that the preservation score of an item \(\mathbf{e}\in\mathcal{L}\) depends on _the sum of the confidence scores of the rankers who included it in their preference lists (steps 15-17)_.