NaiveSoft

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

Naive soft: Frequency distribution

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

Naive soft: Frequency distribution of labels

\[\mathrm{NaiveSoft}(i, \mathcal{D}) = \left(\sum_{j\in\mathcal{A}(x_i)}\mathbf{1}(y_i^{(j)} = k)\right)_{k\in[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

get_probas()

Get soft labels distribution for each task

Returns:

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