auepc_score#

empulse.metrics.auepc_score(y_true, y_score, *, clv, alpha=6, beta=14, incentive_fraction=0.05, contact_cost=15, normalize=True, check_input=True)[source]#

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].

See also

empb : to return the maximum profit and threshold.

Parameters:
y_true1D array-like, shape=(n_samples,)

Binary target values (‘churn’: 1, ‘no churn’: 0).

y_score1D array-like, shape=(n_samples,)

Target scores, can either be probability estimates or non-thresholded decision values.

alphafloat, default=6

Shape parameter of the beta distribution of the probability that a churner accepts the incentive (alpha > 1).

betafloat, default=14

Shape parameter of the beta distribution of the probability that a churner accepts the incentive (beta > 1).

clvfloat or 1D array-like, shape=(n_samples)

If float: average customer lifetime value of retained customers. If array: customer lifetime value of each customer when retained.

incentive_fractionfloat, default=0.05

Cost of incentive offered to a customer, as a fraction of customer lifetime value (0 < incentive_fraction < 1).

contact_costfloat, default=15

Cost of contacting a customer (contact_cost > 0).

normalizebool, default=True

Whether to normalize the AUEPC score. If True, the score is 1 when the model is perfect. This parameter is only useful if a part of the expected profit curve is negative.

check_inputbool, default=True

Perform input validation. Turning off improves performance, useful when using this metric as a loss function.

Returns:
empbfloat

Expected Maximum Profit Measure for B2B Customer Churn

thresholdfloat

Fraction of the customer base that should be targeted to maximize profit

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.