binary_classification_rate_from_cumsum#
- rojak.turbulence.metrics.binary_classification_rate_from_cumsum(cumsum_for_group: Series | ndarray) BinaryClassificationRateFromLabels | None [source]#
- rojak.turbulence.metrics.binary_classification_rate_from_cumsum(cumsum_for_group: Series) BinaryClassificationRateFromLabels | None
- rojak.turbulence.metrics.binary_classification_rate_from_cumsum(cumsum_for_group: ndarray, min_true_positives: int = 2) BinaryClassificationRateFromLabels | None
Binary classification curve with cumulative sum on labels
Assumes that labels have already been sorted such that the values are increasing. Moreover, the cumulative sum has been performed on boolean truth labels such that it represents the number of true positives (or positive observations). The main use case for this function is on a given group from a Pandas GroupBy object.
- Parameters:
cumsum_for_group (Series | ndarray) – Cumulative sum on boolean truth labels
- Returns:
True positive and false positive rate. If there are no true positives, returns None
- Return type: