1
$\begingroup$

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?

$\endgroup$
2

2 Answers 2

2
$\begingroup$

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
$\endgroup$
1
$\begingroup$

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

$\endgroup$
1
  • $\begingroup$ in your training (and test) data did you then replaced the Date_time column with a 'contiguous_secs' (int) column? $\endgroup$
    – sAguinaga
    Dec 9, 2019 at 17:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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