How to represent Date Values in ML datasets

Many times we encounter data sets with date values as one of the feature to handle in machine learning problems (e-g historical data of share prices of a company over the period of time, with date as one feature).

One of the way to represent dates in ML datasets is converting it to equivalent numerical representation. I usually convert dates to unix timestamp value to handle better with numerical calculation in ML algorithms.

Excel have a easy way to convert cell value to unix time stamp. Excel stores dates internally as number of days since January 1, 1900.
In order to convert we can use the following formula

=(CellValue-DATE(1970,1,1))*86400

 
0
Kudos
 
0
Kudos

Now read this

Jul 2007: What Is Your Passion?

Every one knows that, if you do your job with passion then success is 100% guaranteed. What if you really don’t know what is you passion is?. Most of the time people really don’t know what their real passion is. What ever they thought... Continue →