How to model & predict user activity/presence time in a website I need to make a prediction model based on some historical data from a website's user login system. Suppose my dataset has some features like user login time and logout time for each day for a specific user. Login and logout times can be multiple in a day for a specific user. Suppose, If the user login 5 times in the website in a day, there will be five entry points as rows to the dataset for that user, logout also works like this. Now from the login and logout time, I need to find out the active time that user was logged in to the website as well as predicting the inactive time in which user is not available/present in the website. How can I do this? Which algorithm should I use and which prediction model (Linear regression/Logistic Regression/Time series) need to choose in this case? It will be very much helpful if you can suggest me for this specially to implement in R. Thanks.

Edit:

Actually I need to find out/predict a time in which the user is active in a website during the day. I have a dataset with 3 columns listed as "user_id", "login_time" and "logout_time". Now I am trying to make another column "active_time" in which I'm trying to compute the user's active time in the website by subtracting the login time from logout time and it can be multiple as user can access website multiple times in a day. Now I need to predict the time in which the user is active in the website where active time is the target variable and login, logout time as predictor. I also trying to make a linear regression model for this prediction. But I don't know whether my process is correct or not for this problem. Can anyone please let me know which type of model I need to build for this prediction? Is it will be Linea regression, logistic regression or time series ?
I suggest approaches based on neural networks for time to event data. Depending on your data I think you can also use 

https://www.slideshare.net/mobile/datasciencelondon/survival-analysis-of-web-users

https://arxiv.org/abs/1807.04098

https://arxiv.org/abs/1801.05512

https://machinelearningmastery.com/multivariate-time-series-forecasting-lstms-keras/