IWMV

class IWMV(answers, n_classes=2, sparse=False, **kwargs)

Iterative Weighted Majority Vote

Iterative Weighted Majority Vote (IWMV) is a model that iteratively updates the weight of each worker based on their performance. The weight of each worker is updated at each iteration based on their accuracy in the previous iteration of weighted majority vote aggregation.

__init__(answers, n_classes=2, sparse=False, **kwargs)

Iterative Weighted Majority Vote. Initialize with a majority vote. Then at each step \(t\),

\[\mathrm{IWMV}(i, \mathcal{D})^t = \underset{k\in[K]}{\mathrm{argmax}} \sum_{j\in\mathcal{A}(x_i)}\beta_j^t\mathbf{1}(y_i^{(j)} = k)\]

with

\[\beta_j^{t} = \frac{1}{|\{y_{i'}^{(j)}\}_{i'}|} \sum_{i'=1}^{n_{\texttt{task}}} \mathbf{1}\left(y_{i'}^{(j)} = \mathrm{IWMV}(i', \{y_{i'}^{(j)}\}_j)^{t-1}\right).\]
Parameters:
  • answers (dict) –

    Dictionary of workers answers with format

    {
        task0: {worker0: label, worker1: label},
        task1: {worker1: label}
    }
    

  • sparse (bool, optional) – If the number of workers/tasks/label is large (\(>10^{6}\) for at least one), use sparse=True to run per task

  • n_classes (int, optional) – Number of possible classes, defaults to 2

compute_baseline(weight=None)

Compute label frequency per task

MV(weight=None)

Majority voting aggregation with random draw

accuracy_by_mv()

Compute accuracy of each worker based on previously aggregated labels

run(nb_iter=10, **kwargs)

Iteratively run WMV and update worker weights for \(\texttt{nb_iter}\) iterations. If \(\texttt{nb_iter}=1\), recovers WAWA aggregation.

get_answers()

Get labels obtained with majority voting aggregation

Returns:

Most answered labels per task

Return type:

numpy.ndarray

get_probas()

Get labels obtained with majority voting aggregation

Returns:

Most answered labels per task

Return type:

numpy.ndarray