net_benefit

Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.

net_benefit(y_true: ndarray, y_prob: ndarray, threshold: float) → float[source]

Decision-curve net benefit at one threshold probability.

Parameters:
  • y_true – Binary labels (0/1).

  • y_prob – Predicted positive-class probabilities in [0, 1].

  • threshold – Probability threshold in [0, 1).

Returns:

Net benefit at threshold (0.0 when undefined).