morphoclass.cleanlab module

CleanLab analysis of labeled data.

morphoclass.cleanlab.analysis(labels: np.ndarray, probas: np.ndarray)tuple[np.ndarray, np.ndarray]

Use CleanLab to detect potential label errors.

Parameters
  • labels – The labels of the data. Should have shape (n_samples,).

  • probas – The class probabilities predicted by a trained model. Should have shape (n_samples, n_classes).

Returns

  • label_error_ids (np.ndarray) – The indices of data with potential label errors found by CleanLab. The shape is (n_bad_labels,).

  • self_confidence (np.ndarray) – The self-confidence score of the outliers, shape is (n_bad_labels,). The self-confidence is the predicted probability of the true label.

morphoclass.cleanlab.check_installed()bool

Check whether the CleanLab package is installed.

Returns

Whether the CleanLab package is installed

Return type

bool

morphoclass.cleanlab.how_to_install_msg()str

Get installation instructions for CleanLab.

Returns

The instructions on how to install CleanLab.

Return type

str

morphoclass.cleanlab.warn_if_not_installed()None

Issue a UserWarning if CleanLab is not installed.