40  Circular Features

When working with datetime features, there are a couple of instances where it is useful to work with them in a purely circular sense. We will cover those instances and why we would want to do it in this chapter. For a broader and more comprehensive look at how to work with circular features, see the Chapter 61 section.

To make things perfectly circular we need to work with regular units of seasonality. This is quite nice as we have the units that are going to guide the circular nature of the effects. This is unlike other types of circular data where we need to find the scale of the period.

We can work with things like hours, days and weeks directly. But we need to take extra care when working with uneven periods such as months and years, since the months are not all the same length, and leap years exist. One way to deal with this is to work with the decimal representation.

Once we have the datetime variables in the right format, all we have to do is find an appropriate circular method in Chapter 61 and apply it.

TODO

Wait for recipes step to show how this would look

40.2 Pros and Cons

40.2.1 Pros

  • The nature of datetime variables naturally leads to circular patterns

40.2.2 Cons

  • Extra care and work need to be done to find the right period

40.3 R Examples

TODO

Add recipes steps

40.4 Python Examples