Problem

A client should be regarded as having a higher churn risk if they used to make a purchase once every 20 days on average but have been inactive for 50 days. She might be about to choose a competitor's product line instead of our company. When our tool alerts the marketing team to consumers with high churn risks, they can consider discounts, promotions, and other outreach measures.

We need a model that alerts us to clients who are at risk of leaving. Additionally, we want it to forecast how much each customer will spend. Additionally, it ought to determine the lifetime values of each of our clients while we're at it.

Solution

These techniques are known as Buy 'Til You Die Models in data science. BTYD (Wikipedia): From a customer's "birth" (when she places her first purchase with our company) to the day of her "death" (when she chooses a rival and is hence dead to us, the firm she has spurned).

Source code