I want to build do classification to determines if a user will visit another page on the website before logging out. So it's making a binary prediction: last page or not last page.

Would variables that are constant between pages (e.g. user age, user gender) add any value to the model or no?

I mean, I suppose age and gender may be somewhat correlated with the typical number of pages a user visits, but we would already include mean number of page a user visits as a feature.

Would the answer to the question depend on the type of classification algorithm used?

  • $\begingroup$ Suppose you're on a site where old people stay for hours and hours, but young people leave right away. (Maybe it follows step function at age 18.) Obviously, age affects your predictions. Am I mis-understanding your question? $\endgroup$ – eric_kernfeld May 16 '17 at 21:17
  • $\begingroup$ Do you include individual fixed effects? $\endgroup$ – Matthew Gunn May 16 '17 at 22:01
  • $\begingroup$ To clarify, for each user we want to make a prediction. Each user visits, say 5 pages on average (and maybe it does change by age or gender). As they go through each page, we want to predict: is this the last page? $\endgroup$ – mkishida May 17 '17 at 14:17

Your question may be wrongly worded, as the age or gender of a person does not really stay the same between the two categories, which are whether the user will visit another page or not. This is because for a given user, they cannot be in both categories at the same time.

But whether there is any correlation between certain features and the propensity of a user to stay on that page or not, needs to be found from the data. You would ideally like to consider a large pool of possible features and then perform feature selection to prune out the ones that do not seem to be correlated.

  • $\begingroup$ I think I wasn't very clear. So a user will go on the website and visit for instance 5 pages. Each page they visit, we want to predict whether it's their last page. So, for pages 1-4, the answer is no. For page 5, the answer is yes. Demographics data for that individual user will remain the same between pages 1-4 and 5. $\endgroup$ – mkishida May 17 '17 at 14:19

The answer to this question hinges on whether you already include individual fixed effects.

An interpretation of your question:

Q: If I already have individual fixed effects in my model, can I increase prediction power by adding right hand side variables (eg. gender) that don't vary within an individual?

A: In the context of classic linear models (eg. linear regression), the answer is no. All it would do is change your estimate of the fixed effects and none of your predictions would change at all.

If you ran the following two regressions: $$y_{it} = \hat{a} + \hat{b}_1 x_{it} + \hat{u}_i +\hat{\epsilon}_{it}$$ $$y_{it} = a + b_1 x_{it} + b_2 z_i + u_i + \epsilon_{it}$$

Your forecasting power would be the same, and you'd have $\hat{u}_i = b_2 z_i + u_i$.

Q: Moving beyond ordinary least squares regression, could it change things?

A: Yes. In the most general sense, you need not have the equivalence. I would not expect it to improve things (since the data is collinear), but perhaps in certain contexts it could? Eg. repeating the same feature in a random forest could give it a higher probability of being selected etc...


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.