-1
$\begingroup$

I have a feature with data creation dates. I have normalized them all to the same format and split them to 'day', 'month' and 'year' columns. But now I have a question. Should I apply normalization or standardization to these columns, or on dates this does not have sense?

$\endgroup$
1
$\begingroup$

You might want to apply one-hot encoding instead. These are not really continuous features. If you consider each day of the week or month of the year a category, then you can instead treat them as categorical variables.

The year is trickier as it does not repeat itself. I would suggest to maybe instead of using the year to use a date difference: which can now be treaded as a continuous variable. You can do any regular scaling (standard scaling, max abs scaling ...)

$\endgroup$
2
  • $\begingroup$ Thanks for your time, I will try the anual difference as you suggested. However, for those cases where I only have one date, would it have sense to get the year in a column and scale it, lets say, with a MaxMinScaler? @RonsenbergVI $\endgroup$ – Luiscri Apr 20 at 14:08
  • 1
    $\begingroup$ Not really, because you will end up treating the date as a continuous variable. Your model might learn something like: if this variable is positively correlated with the year then in 100 years this variable will be 100x its current value, which false. So that's why you want to be careful when working with a date outside of a pure time series model. $\endgroup$ – RonsenbergVI Apr 21 at 9:05

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.