# time series for each customer to predict time to leave?

I am a beginner in the domain of forecasting and I was wondering if such a problem could be solved with time series analysis :

given customer historical data of taxi pickups,along with the weather condition feature, is it possible to analyze their behavior on rainy days and predict their time to leave? (means at what time might a customer x picks up a taxi next time knowing that he went out at 6:42 am yesterday, 7:00 am two days ago, 6:00 am three days ago ...and so on )?

here's how the data looks like globally :

any guidance on how I can do this? is it a problem that can be tackled with time series? given that the problem here consists of predicting the time to leave, unlike their classic usage like sale forecasting and so on.

I would extremely appreciate any advice on methodologies implementing this.

You actually have two different, though related, questions: whether your customer will pick up a taxi at all, and if so, at what time. (Depending on where your data come from, you may not even know whether someone picked up a taxi, for instance, if there are multiple taxi companies operating.)

I would address both problems in a similar way, with a logistic link function to model the probability that someone picks up a taxi at all.

The most important driver will likely be the day of week. Other drivers may be the weather and the time of year, followed by some autoregressive behavior.

My first approach would be a regression with autoregressive behavior: fit a logistic regression of whether or not someone picked up a taxi, with the day of week, the weather, the time of year (e.g., using some Fourier terms) and whether they picked up a taxi on the previous day(s).

Then fit a similar model for when they pick up a taxi, using the same regressors except for the last. Here, use the last previous time they picked up a taxi, whenever that was.

You could fit separate models for each customer, or use one general model with separate intercepts for each customer.

• thanks a lot for your help, however, I didn't get the first part that concerns the likelihood of a customer to pick up a taxi, if we suppose that we create a logistic regression to predict whether they will pick up a taxi or not (1/0), that means we need to label data since it's not , right? (i mean new column with 1 if he picked up a taxi, and 0 for other days ) , add to this that if we consider that our period of study is 3 years, I will need to have a complete sequence for each customer of 1095 days (365 * 3 ) ?? Mar 18, 2020 at 18:34
• Yes, you will need that. If you know on which dates the customer picked up a taxi, then you know on which dates he didn't. If your customers pick up taxis multiple times, then something like a Poisson regression may be appropriate. Possibly zero-inflated. Mar 19, 2020 at 15:48