Entropy

class Entropy(answers, **kwargs)

Computes the votes’s distribution entropy per task.

__init__(answers, **kwargs)

For each task, first compute the Naive Soft distribution. Then, obtain the entropy of the distribution.

With enough votes, the higher the entropy, the more uncertain the task.

\[\mathrm{H}(i, \{y_i^{(j)}\}_j) = -\sum_{k=1}^{K} p_k \log(p_k)\ \mathrm{with}\ p=\mathrm{NS}(\{y_i^{(j)}\}_j)\]
Parameters:

answers (dict) –

Dictionary of workers answers with format

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

The number of classes n_classes should be specified as keyword argument.

run(path)

Computes the entropy and save it for each task

Parameters:

path (str) – path to save the entropies. The file will be saved as <path>/entropies.npy