multiannotator_utils#

Helper methods used internally in cleanlab.multiannotator

Functions:

assert_valid_inputs_multiannotator(...[, ...])

Validate format of multi-annotator labels

format_multiannotator_labels(labels)

Takes an array of labels and formats it such that labels are in the set 0, 1, ..., K-1, where K is the number of classes.

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, where K 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 that mapping[k] returns the name of the k-th class.