So I am trying to predict which customers would leave a loyalty program sponsored by X firm, using an ML classification model.

I further believe that the duration for which a customer has been in the program affects their likelihood of staying/leaving the program, for reasons such as long-term customers get more loyalty discounts etc.. which may raise the indirect cost/price of them leaving a program.

However, one issue that I am currently facing, is that I am calculating duration_in_program, based on the start_date and end_date for each customer.

However, I think one issue with this approach of coding the variable is that there are values for duration_in_program that don't map to any "stayed" outcomes. Which kind of makes sense. Like, if everyone in the program with a duration_in_program of 3 yrs left the program, then the model will just learn to always predict that as "left".

It is crucial to point that: the program allows customers to stay in the program for a maximum period of five years, after that point, they receive regular prices paid by other cable customers.

Therefore, one way I am thinking of dealing with this is that duration_in_program, is determined by an arbitrary cutoff point. For instance, if they still have not left the program by the date at which the 1st cohort completes the program (i.e. 31/08/2017), then we consider their duration_in_program equal to that. So someone that joined in (i.e. 01/09/2013), and still has not left by 31/08/2017, then we set their duration_in_program=4.

Any thoughts on my approach above?


1 Answer 1


What you are describing sounds much like a survival model, where you have observations that are still surviving (still in the program) and observations that died along the way (attrition).

You would want to look into survival methods and how to censor your data. There are basic regression methods for this where you are trying to predict time-until-event. XGBoost can also handle censored data for survival.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.