empc_score#

empulse.metrics.empc_score#

Expected Maximum Profit Measure for Customer Churn (EMPC).

EMPC 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. As opposed to empb_score, the incentive cost is a fixed value, rather than a fraction of the customer lifetime value. For detailed information, consult the paper [1].

See mpc_score for a deterministic version of this metric.

The EMPC is defined as [1]:

\[\int_\gamma CLV (\gamma (1 - \delta) - \phi) \pi_0 F_0(T) - \ CLV (\delta + \phi) \pi_1 F_1(T) d\gamma\]

The EMPC requires that the churn class is encoded as 0, and it is NOT interchangeable. However, this implementation assumes the standard notation (‘churn’: 1, ‘no churn’: 0).

Methods

__call__(y_true, y_score, *, alpha=6, beta=14, clv=200, incentive_cost=10, contact_cost=1)

Compute the expected maximum profit that can be achieved by a classifier at its optimal decision threshold.

optimal_threshold(y_true, y_score, *, alpha=6, beta=14, clv=200, incentive_cost=10, contact_cost=1)

Compute the classification threshold that maximizes the expected profit.

optimal_rate(y_true, y_score, *, alpha=6, beta=14, clv=200, incentive_cost=10, contact_cost=1)

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

References

[1] (1,2)

Verbraken, T., Verbeke, W. and Baesens, B. (2013). A Novel Profit Maximizing Metric for Measuring Classification Performance of Customer Churn Prediction Models. IEEE Transactions on Knowledge and Data Engineering, 25(5), 961-973.

Examples

from empulse.metrics import empc_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]
empc_score(y_true, y_score, alpha=6, beta=14, clv=200, incentive_cost=10, contact_cost=1)