WDS

class WDS(answers, n_classes=2, **kwargs)

WDS: Weighted Distribution from Dawid and Skene

Use the diagonal of the confusion matrix from DS model to weight the label frequency for each worker.

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

Weighted Majority Vote from DS confusion matrices diagonal.

\[\mathrm{WDS}(i, \mathcal{D}) = \underset{k\in[K]}{\mathrm{argmax}} \sum_{j\in\mathcal{A}(x_i)}\pi_{k,k}^{(j)}\mathbf{1}(y_i^{(j)} = k)\]
Parameters:
  • answers (dict) –

    Dictionary of workers answers with format

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

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

run()

Run DS model to get confusion matrices

get_probas()

Get soft labels distribution for each task

Returns:

Weighted label frequency for each task

Return type:

numpy.ndarray(n_task, n_classes)

get_answers()

Argmax of soft labels, in this case corresponds to a majority vote

Returns:

Hard labels (majority vote)

Return type:

numpy.ndarray