def _get_pos_class(df, class_feat, pos_class):
    """Get or infer the positive class name."""
    if pos_class is not None:
        return pos_class
    class_values = sorted(df[class_feat].unique())
    if len(class_values) == 2:
        try:
            class_values = [class_values[0].item(), class_values[1].item()]
        except:
            pass
        if class_values[0] is 0 and class_values[1] is 1:
            return 1
        elif class_values[0] is False and class_values[1] is True:
            return True
    raise NameError(
        f"Couldn't infer name of positive target class from class feature: {class_feat}. Try using parameter pos_class to specify which class label should be treated as positive, or renaming your classes as booleans or 0, 1."
        )
