Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance Datetime Features with Cyclical Encoding to Preserve Metric #1127

Closed
mmartinb75 opened this issue Oct 26, 2024 · 3 comments
Closed

Comments

@mmartinb75
Copy link

Problem Description

The library currently extracts datetime features like hour, day, month, etc., but doesn't account for their cyclical nature. This can lead to models misinterpreting the relationship between time features. For example, the model might treat hour 23 as being far from hour 0, while in reality, they are adjacent.

Feature Description

Add two new features for each extracted datetime component (second, minute, hour, day, month, and week) using sine and cosine transformations. The frequencies for each component will match its cyclical property: 60 for second and minute, 24 for hour, the actual number of days in the given month for day, and 12 for month.

@rcap107
Copy link
Contributor

rcap107 commented Oct 28, 2024

Related to #907

@jeromedockes
Copy link
Member

jeromedockes commented Oct 28, 2024

thanks @mmartinb75 that's a great suggestion and as @rcap107 mentioned it is being discussed in #907 . basically the discussion has sort of stalled on the topic of using sin or splines, but it would be great to revive it and add this.

I will close this issue to avoid duplicating the conversation but I'll link your comment from there and please feel free to engage in the discussion in #907 !

@mmartinb75
Copy link
Author

right!!. thanks a lot @jeromedockes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants