This is something that looks very simple to solve, but I couldn't find any hint - perhaps I'm not asking Google the right question.

Let's say you own an Internet Company. You have the total consumption of your customer in the current month, the consumption from last month and the month before. You want to create a feature named "month_consumption_variation" and "2month_consumption_variation", the first is the result of the consumption from the current month divided by last month consumption, then we subtract one from the result. The same thing is done for the second feature, but with the month before the last one (~lag 2).

Basically, I believe that if the customer is decreasing or increasing its consumption, this is a sign of him changing its internet provider or not. However, there are two situations here: (1) the customer didn't consume anything last month - or the month before -, even though he was already a customer; (2) the customer wasn't my customer at that time. What I mean is that my denominator can be zero or null. If I use the denominator, I will get an error message.

What kind of solutions can be applied here? Are there any differences between the solution for (1) and for (2)?


1 Answer 1


You are describing time series data. Lag values are typically not divided. Lag values are typically subtracted, thus zero values are an issue.

Time series variations are often modeled with autoregressive integrated moving average (ARIMA).


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.