0
$\begingroup$

If I use sine, cosine transformation for cyclical features (e.g. weekday or hour of the day), do I lose information if the first ordinal value was 0 respectively?

Assume hours of the day are encoded as follows: 0, 1, ..., 23

If I apply the sine, cosine transformation, I get 23 data points instead of 24 (cf. plot)

enter image description here

Am I losing information on the first ordinal value (0)?

Many thanks in advance!

$\endgroup$
0
$\begingroup$

Are 0 and 23 supposed to be the same?

If not then you should use $( \sin(2i\pi/24),\cos(2i\pi/24) )$ instead of $( \sin(2i\pi/23),\cos(2i\pi/23) )$ with $i \in \{0,...,23\}$

$\endgroup$
1
  • $\begingroup$ no they are not the same. 0 aggregates the time between 00:00 and 00:59 am, while 23 aggregates the time between 23:00 and 23:59 so the solution you provided is perfect! thank you! $\endgroup$ – jacobumland Nov 22 '20 at 15:31

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.