# How to predict customer churn by a certain date?

I have a dataset of inactive users for the last 365 days, with columns:

1. When subscribed (e.g. 10.10.2022)
2. When unsubscribed (e.g. 12.10.2022)

and client info

I also have a set of data about active users:

1. When subscribed

and client info.

Question: How can I get a prediction of whether a certain user will unsubscribe within a month from now? What should be the logic of my actions in this case?

I tried to calculate an unsubscribe date using linear regression and got a result, for example, 03.15.2023. But in that case, I can't understand with what probability the person will unsubscribe in a month, namely on 01.12.2023

I will be grateful for any hints. Thanks

• You will first need to preprocess your data by converting the "when subscribed" and "when unsubscribed" columns to a numerical format that the model can understand.
– Vic
Dec 12, 2022 at 13:40
• @Vic Yes, I converted them to the Unix timestamp format. There is no problem with that. But thanks for the advice.
– Quaw
Dec 12, 2022 at 13:47
• You may be interested in survival analysis. Dec 12, 2022 at 14:13

## 1 Answer

This problem is better framed as survival analysis, the expected time duration until an event occurs. The goal would be to fit a model that predicts the probability of churn as a function of the number of days thus far and other features.