I'm working with some turnstile data.
My factor variables are day of week (e.g, Monday - Sunday) and binned hour of day (e.g, 4, 8, 12, 16, 20, 00).
My question is straight forward:
To create a set of simple interaction variables (a la Python Scikitlearn PolynomialFactors) is it best to:
Change day labels to integers and multiply by the numerically represented hour of day bins?
Change day labels to integers, then one hot encode both the days of week and hours of day, then determine the interaction variables?
Does it matter whether I use 1 or 2?
I'm thinking #2. But I only understand it on an intuitive level. It seems, using that one hot encoding both sets of factor variables and then running them through PolynomialFactors yields observations that are in dummy variable form and take into consideration both sets of factor variables as well as interacting variables. Can someone confirm?
I would think #1 is NOT the way to go about creation of interaction variables in this case because the digitized days (0-6) and bins (0, 4, 8, 12, 16, 20) would imply hierarchy and multiplying the two sets directly would provide unwanted weights when creating the interaction variables.
Hoping someone can confirm or correct my insights and provide some more color into the creation of interaction variables.