adjust_threshold#

mlquantify.utils.method.adjust_threshold(y, probabilities: ndarray, classes: ndarray) tuple[source]#

Adjust the threshold for a binary quantification task to maximize the True Positive Rate.

Parameters:
ynp.ndarray

The true labels.

probabilitiesnp.ndarray

The predicted probabilities.

classesnp.ndarray

The unique classes in the dataset.

Returns:
tuple

The best True Positive Rate and False Positive Rate.