-
Notifications
You must be signed in to change notification settings - Fork 483
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
[minor] Support data without datestamps #1188
Conversation
Hi @SimonWittner, I know you are just getting started with this pr - but maybe have a look at this. This will make it easier to have meaningful commit messages, pr titles and so on :) Also, the model/metrics pytest does currently not work from forks yet. You can ignore it if that pytest fails for now. |
Welcome @SimonWittner ! |
Thank you for your messages! @karl-richter please let me know, if I can further improve the PR. |
Codecov Report
@@ Coverage Diff @@
## main #1188 +/- ##
==========================================
- Coverage 89.88% 89.74% -0.15%
==========================================
Files 38 38
Lines 5103 5139 +36
==========================================
+ Hits 4587 4612 +25
- Misses 516 527 +11
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @SimonWittner for your contribution!
While I was thinking of adding true support for data without datestamps, which would be entail large codebase changes, your approach is a rather simple alternative that may get the job done. I think this is a good addition, so I'd like to proceed to get your contribution merge-ready.
To do so, I suggest to still do the following:
- rename mentions of 'random' to 'dummy' or 'placeholder'
- use seconds as the frequency (to avoid issues with very long time-series)
- make sure to disable auto-seasonality when your code is triggered. (as the daily/weekly/yearly seasonalities will have no meaning)
- May there be a better location (less nested and less frequently called) than
prep_or_copy_df
for your code to be called? - Add to the user warning that the frequency was set to seconds
- soft suggestion: have the function only return a series of datestamps, (no passing of df), and use a more efficient implementation of adding the column to the df than concat (outside the function).
Please let me know if you disagree with my suggestions or have further ideas
7d25eae
to
9b5e6c8
Compare
Thank you @ourownstory for your feedback! I implemented all your suggestions. Please let me know if I can further improve the PR! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just change back to IDs and lets check why one test fails
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good changes!
I noticed that the model is passed to the datestamp creation function.
Let us separate the disabling (editing of model config) from the timestamps creation.
So, for datestamp creation function, let us not pass the model, but only the precise args that are needed.
Further, the editing of model parameters (in a separate function), should not happen in make_future_dataframe
. If seasonalities are enabled there and no datestamps present, it should create an error.
neuralprophet/df_utils.py
Outdated
@@ -513,6 +511,42 @@ def check_single_dataframe(df, check_y, covariates, regressors, events, seasonal | |||
return df | |||
|
|||
|
|||
def create_dummy_datestamps( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall!
Let us separate the disabling (editing of model config) from the timestamps creation.
So, for this function, let us not pass the model, but only the precise args that are needed.
@ourownstory in the latest commit, I removed the function call for I think that it would be prettier to leave the function call in Please let me know which commit you prefer! |
Handling of data without datestamp fixed with #1432 |
🔬 Background
🔮 Key changes
📋 Review Checklist