-
Notifications
You must be signed in to change notification settings - Fork 11
/
datetime-circular.qmd
49 lines (32 loc) · 1.57 KB
/
datetime-circular.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
pagetitle: "Feature Engineering A-Z | Circular Datetime Features"
---
# Circular Features {#sec-datetime-circular}
::: {style="visibility: hidden; height: 0px;"}
## 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 [Circular section](circular).
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 the [Circular section](circular) and apply it.
::: callout-caution
# TODO
Wait for recipes step to show how this would look
:::
## Pros and Cons
### Pros
- The nature of datetime variables naturally leads to circular patterns
### Cons
- Extra care and work need to be done to find the right period
## R Examples
::: callout-caution
# TODO
Add recipes steps
:::
## Python Examples