1

I am using Python/Scikit to do data encoding before I go ahead and train my Neural Network. I have a few columns that look like this

07:05:00
08:41:00
17:25:00
12:58:00
08:56:00
11:59:00
17:25:00
15:24:00

Any suggestions on how to encode this? Or is leaving it like this fine?

2 Answers2

2

A common step in "feature engineering" is parsing these out into multiple values that might give you additional information during ML. For example:

  • Hour of the day
  • Minute of the hour
  • Hours after sunrise
  • Hours before sunset

If you also had day, that would open a lot more to detect seasonality like:

  • Month of the year
  • Month of the quarter
  • Day of the week
  • Holiday Y/N
CalZ
  • 1,663
  • 7
  • 14
1

I have decided to convert the strings into seconds. Since these are all Time of Day values, I will convert them to contiguous seconds.

https://stackoverflow.com/questions/10663720/converting-a-time-string-to-seconds-in-python

  • in your training (and test) data did you then replaced the Date_time column with a 'contiguous_secs' (int) column? – sAguinaga Dec 09 '19 at 17:20