1
$\begingroup$

I have the Data of 10,000 users Time Session in a website/App, The Login time, logout time, the person activity,

The Data is available for 60 days ( per user )

Using this 60 days data for 10k users, can I predict the active time of the respective user on 61st day? if yes what is the best approach and please suggest which type of problems I can refer to solve this

Thank you

$\endgroup$
4
  • $\begingroup$ What do you want to do with that information? Knowing how the prediction will be used may help people give you good advice. $\endgroup$ Commented Apr 15, 2020 at 15:45
  • $\begingroup$ What you have is a regression problem. That gives you two options depending on the data => time-series model or an ML model. I'd go with an ML model $\endgroup$ Commented Apr 15, 2020 at 19:52
  • $\begingroup$ are there 10K distinct user ? (I assume no) - how many users (different user_id) do you have ? $\endgroup$
    – user702846
    Commented May 28, 2021 at 11:47
  • $\begingroup$ I would go in the clustering domain to see if you cannot group the different data $\endgroup$ Commented Jun 22, 2023 at 15:06

2 Answers 2

0
$\begingroup$

Convert your training data to the following format -

a = login_time
b = logout_time
c = person_activity
train_data_X = [
               [[a, b, c], [a, b, c], ......, [a, b, c]]
               [[a, b, c], [a, b, c], ......, [a, b, c]]
               .
               .
               .
               [[a, b, c], [a, b, c], ......, [a, b, c]]
             ]

train_data_Y = [
                 [[time_day_1], [time_day_2], ...... [time_day_60]]
                  .
                  .
                  .
                 [[time_day_1], [time_day_2], ...... [time_day_60]]
                ]

Explaination -

You Input(training_data_X) data has shape 10000 * 60 * 3 because you have 10K users, data for 60 days and each data point depends on 3 variables namely a, b and c. Your Target(training_data_Y) data has shape 10000 * 60 * 1 because you have just one number to output i.e active time.

Now, this is a Regression Problem because you are trying to predict a continuous value i.e active time.

You can model this type of problem with a number of time-series models. But since you got a multivariate input, i.e [a, b, c](refer training_data_X). You would be benefitted a lot using a Seq2Seq model to generate your time-series. If just want to generate 61st time-step you could use it just for that as well.

Specific details and implementation

$\endgroup$
7
  • $\begingroup$ you don't have user_id - do you ? then how does the model learn about each user_id activities ? $\endgroup$
    – user702846
    Commented May 28, 2021 at 11:45
  • $\begingroup$ The first dimention i.e the 10000 rows or in this case matrices are your users. Assign any id to them. $\endgroup$ Commented May 30, 2021 at 22:01
  • $\begingroup$ 1) I don't see any user here -> a = login_time b = logout_time c = person_activity - yes, these are user information but do not specify which user - even if they are user_id, how does that gonna look after all those numerical transformation ? - 2) the link you have added at the end, is not repeated measurement - every household is in one row - in this question one user is not necessarily one row $\endgroup$
    – user702846
    Commented May 31, 2021 at 7:34
  • $\begingroup$ 1st row is first user. 2nd row is second user. Like sentences words and characters. $\endgroup$ Commented Jun 1, 2021 at 8:17
  • $\begingroup$ Only difference between the link I posted and the problem here is I additionally suggested dividing it day wise adding one more dimension to the "user" row $\endgroup$ Commented Jun 1, 2021 at 8:18
0
$\begingroup$

This problem is a time series forecasting problem. First and foremost step to any data problem is to first understanding data. Just preprocess the data keeping in mind the target variable. i.e. active time by each user. So

FIrst Aggregate your Data. Summarize each user's daily active time over the 60 days. This can be done by calculating the total session time for each day. This will prepare our time series for each user. This way for each user a separate time series will be formed.

Next Create features that can help in prediction, such as the day of the week, whether it's a weekend or weekday, any holidays, and previous days' active times.

Start with Trend Analysis. Look for any trends or patterns in the active time over the 60 days. Try to identify if there are weekly or monthly seasonality patterns. FOcus if certain users have consistent patterns or if there are segments of users with similar behaviors. Like you can define categories of users which have common active times.

Model Selection i.e. Time Series Models, Use models that are designed for time series forecasting, such as ARIMA, SARIMA, or Holt-Winters Exponential Smoothing. Also you can utilize other machine learning models like Random Forest, Gradient Boosting, or LSTM (Long Short-Term Memory) networks, which can capture complex patterns in the data.

FOr more information, you can study articles on medium. Time series forecasting problem tutorial

$\endgroup$

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.