Aito.ai — Using time series forecasting for predicting Freska’s customer churn

This is a real-life case example of using time series forecasting to predict customer churn for a high growth startup. Freska is a Nordic success story disrupting the cleaning industry.

Predicting customer churn is relatively simple when using snapshot data. Within Python, you could set up a predictive model to predict future customer churn based on the characteristics of customers that have churned in the past. However, if you want to predict churn from time series (that is from customer lifecycle data), the prediction becomes more tricky.

Another option for doing the prediction over a time series would be creating a neural network model. This model might work for starters but would set problems once you want to incorporate new or more complex data later on. It’s not scalable. Also, the neural network only predicts the churn, but it couldn’t explain what factors are indicators for their probable churn.

Aito’s predictive database, except for doing the predictive part, will also return explainable results — as in, giving you the reason why a certain customer might be churning. The reason could be because the customer satisfaction ratings are low, or in case of a service business, there could have been too many changes in who is taking care of their case. Having these explainable results will help the company not only to anticipate but also to decrease the churn rate — thanks to explaining the underlying reasons behind the important numbers.

And we’re not stopping there. By amending the data with data about actions taken in order to retain the customer, the Recommend API endpoint could also be used to recommend the most suitable action to prevent a possible churn. As you might now realize, it’s not snapshot data Aito uses — it’s the whole database.

Customer case: predicting churn for Freska

Let’s look at the different steps involved in setting up churn prediction with Aito.

1. Collecting the data

For this POC, we use 2 different data sources:

a. Customer bookings, which contains:

  • Address information: Postcode, City, Country
  • Booking details: Worker, Duration, Frequency, Canceled, if the cleaning place hasdogs, hascats, hasotherpets, PetsInfo, cleaning area, notes
  • Satisfaction metrics: RatingOverall, RatingBehavior, RatingQuality, RatingOnTime, ApprovedByCustomer
  • Marketing information: SalesAgents, SalesAgency

b. Monthly customer metrics data, containing:

  • Number of months from first booking, total booking hours this month
  • A field that is manually entered telling if the customer churned this month (True, False)

2. Preprocessing the data

a. We aggregate the bookings data table and the customer metrics data table into 1 table so that the monthly information (metrics and bookings) of a customer is merged.

The combined table looks like this:

b. Aito does not natively support time-series format. So in order to use the different monthly data points, we do another aggregation so each customer will only have one entry. The table now has more columns to store the status of the previous x month, and now looks like this:

Prev0month is the information of the previous month (comparing to the predicting month). Prev1Month is the information of the previous 2 months E.g: Predicting July, Prev0Month = June, Prev1Month = may

3. Using the predict api endpoint

We can now use Aito Predict query to predict the churn status next month of customer with id 0:

{
"from": "trainingData",
"where": {
"totalHoursThisMonth": "5",
"bookingHoursThisMonth": "2 3",
"churnStatusThisMonth": true,
"totalHours1MonthAgo": "2",
"bookingHours1MonthAgo": "1 1",
"churnStatus1MonthAgo": false,
},
"predict": "churnStatusNextMonth"
}

As Aito uses all the data in the table as training data, it means it uses also the “churnStatusThisMonth” column values for inference. We solve this by using the data of the previous months but giving Aito the churn status of this month. And as such, using the information from the latest month to predict the next month.

Next steps

These next steps will be covered in a forthcoming blog post. Follow us on Twitter to be the first one to know. If you don’t want to wait, request a trial and we explain how to do the same for your company.

Originally published at https://aito.ai.

Aito.ai predictive database — improved automation rates for your #rpa process. Next generation #ML. Try for free: https://aito.ai