FYI - Feature Engineering the date

Disclaimer: Dieser Thread wurde aus dem alten Forum importiert. Daher werden eventuell nicht alle Formatierungen richtig angezeigt. Der ursprüngliche Thread beginnt im zweiten Post dieses Threads.

FYI - Feature Engineering the date
here are some features that can be extracted from the date

example: 21.03.1993

Linear extraction

  • “day of month”: 21
  • “month of year”: 03
  • quarter: 01 (since 03 is in the first quarter)
  • “day of week” (eg. Monday)
  • etc.

Here is the cool part
Circular extraction

  • part of the dates are circular (day of month, month of year, day of week)
    you can use this fomular to transform the day of month for example (assuming months have 31 days)

x_axis = sin(dayOfMonth * (2.0 * PI / 31))
y_axis = cos(dayOfMonth * (2.0 * PI / 31))

now for each date, you have a point on a graph. If you sort the points and plot them you should get something like the image in the attached section.

in conclusion, from the “day of month” column, you have now extracted two new columns that represent it and so can now be feeded as features

Attachment:
Screenshot 2019-05-22 at 14.51.40.png: https://fsi.cs.fau.de/unb-attachments/post_160566/Screenshot 2019-05-22 at 14.51.40.png