multiannotator_utils#
Helper methods used internally in cleanlab.multiannotator
Functions:
|
Validate format of multi-annotator labels |
|
Takes an array of labels and formats it such that labels are in the set |
- cleanlab.internal.multiannotator_utils.assert_valid_inputs_multiannotator(labels_multiannotator, pred_probs=None)[source]#
Validate format of multi-annotator labels
- Return type:
None
- cleanlab.internal.multiannotator_utils.format_multiannotator_labels(labels)[source]#
Takes an array of labels and formats it such that labels are in the set
0, 1, ..., K-1
, whereK
is the number of classes. The labels are assigned based on lexicographic order.- Return type:
Tuple
[DataFrame
,dict
]- Returns:
formatted_labels
– Returns pd.DataFrame of shape(N,M)
. The return labels will be properly formatted and can be passed to cleanlab.multiannotator functions.mapping
– A dictionary showing the mapping of new to old labels, such thatmapping[k]
returns the name of the k-th class.