auepc_score#

empulse.metrics.auepc_score#

Area Under the Expected Profit Curve (AUEPC).

Calculate the area under the ratio of the expected profit of the model and the perfect model. The expected profit is based on the EMPB’s definition of profit. AUEPC presumes a situation where identified churners are contacted and offered an incentive to remain customers. Only a fraction of churners accepts the incentive offer, this fraction is described by a \(Beta(\alpha, \beta)\) distribution. For detailed information, consult the paper [1].

clv is required and should be a 1D array-like with one value per sample. See empb_score to instead return the maximum profit.

Methods

__call__(y_true, y_score, *, clv, alpha=6, beta=14, incentive_fraction=0.05, contact_cost=15)

Compute the area under the expected profit curve.

optimal_threshold(y_true, y_score, *, clv, alpha=6, beta=14, incentive_fraction=0.05, contact_cost=15)

Compute the classification threshold that maximizes the underlying expected profit (see empb_score).

optimal_rate(y_true, y_score, *, clv, alpha=6, beta=14, incentive_fraction=0.05, contact_cost=15)

Compute the predicted positive rate (fraction of the customer base that should be targeted) at which the maximum underlying expected profit is achieved.

References

[1]

Rahman, S., Janssens, B., Bogaert, M. (2025). Profit-Driven Pre-Processing in B2B Customer Churn Modeling using Fairness Techniques. Journal of Business Research.

Examples

from empulse.metrics import auepc_score

y_true = [0, 1, 0, 1, 0, 1, 0, 1]
y_score = [0.1, 0.2, 0.3, 0.4, 0.5, 0.7, 0.8, 0.9]
clv = [100, 200, 150, 300, 120, 250, 180, 220]
auepc_score(y_true, y_score, clv=clv, alpha=6, beta=14, incentive_fraction=0.05, contact_cost=15)