make_objective_acquisition#
- empulse.metrics.make_objective_acquisition(model, *, contribution=7000, contact_cost=50, sales_cost=500, direct_selling=1, commission=0.1)[source]#
Create an objective function for the Expected Cost measure for customer acquisition.
The objective function presumes a situation where leads are targeted either directly or indirectly. Directly targeted leads are contacted and handled by the internal sales team. Indirectly targeted leads are contacted and then referred to intermediaries, which receive a commission. The company gains a contribution from a successful acquisition.
Read more in the User Guide.
- Parameters:
- model{‘xgboost’, ‘lightgbm’, ‘catboost’}
The model for which the objective function is created.
‘xgboost’ :
xgboost.XGBClassifier
‘lightgbm’ :
lightgbm.LGBMClassifier
‘catboost’ :
catboost.CatBoostClassifier
- contributionfloat, default=7000
Average contribution of a new customer (
contribution ≥ 0
).- sales_costfloat, default=500
Average sale conversion cost of targeted leads handled by the company (
sales_cost ≥ 0
).- contact_costfloat, default=50
Average contact cost of targeted leads (
contact_cost ≥ 0
).- direct_sellingfloat, default=1
Fraction of leads sold to directly (
0 ≤ direct_selling ≤ 1
).direct_selling = 0
for indirect channel.direct_selling = 1
for direct channel.- commissionfloat, default=0.1
Fraction of contribution paid to the intermediaries (
0 ≤ commission ≤ 1
).Note
The commission is only relevant when there is an indirect channel (
direct_selling < 1
).
- Returns:
- objectiveCallable
A custom objective function for XGBoost.
References
[1]Janssens, B., Bogaert, M., Bagué, A., & Van den Poel, D. (2022). B2Boost: Instance-dependent profit-driven modelling of B2B churn. Annals of Operations Research, 1-27.
Examples
from xgboost import XGBClassifier from empulse.metrics import make_objective_acquisition objective = make_objective_acquisition(model='xgboost') clf = XGBClassifier(objective=objective, n_estimators=100, max_depth=3)