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

[minor] Allow lagged regressors with only unique values for global modeling #1256

Merged
merged 6 commits into from
Apr 14, 2023

Conversation

judussoari
Copy link
Collaborator

@judussoari judussoari commented Apr 11, 2023

🔬 Background

Fixes #608
Fixes #1153
Picks up from #1146
Currently, NeuralProphet does not allow a lagged regressor to only contain unique values. When global modeling, however, there are reasonable cases in which some IDs may have only unique values, while others don't.

🔮 Key changes

Instead of throwing an Error immediately, we first check whether we have unique values cross all IDs. If not, we give a warning.

📋 Review Checklist

  • I have performed a self-review of my own code.
  • I have commented my code, added docstrings and data types to function definitions.
  • I have added pytests to check whether my feature / fix works.

*in case of global normalization
*As long as this is not the case for all time series in the dataset
@judussoari judussoari added this to the Release 0.6.0 milestone Apr 11, 2023
@judussoari judussoari self-assigned this Apr 11, 2023
@github-actions
Copy link

github-actions bot commented Apr 11, 2023

Model Benchmark

Benchmark Metric main current diff
AirPassengers MAE_val 15.2698 15.2698 0.0%
AirPassengers RMSE_val 19.4209 19.4209 0.0%
AirPassengers Loss_val 0.00195 0.00195 0.0%
AirPassengers MAE 9.82902 9.82902 0.0%
AirPassengers RMSE 11.7005 11.7005 0.0%
AirPassengers Loss 0.00056 0.00056 0.0%
AirPassengers time 5.83975 4.34 -25.68% 🎉
YosemiteTemps MAE_val 1.71298 1.71298 0.0%
YosemiteTemps RMSE_val 2.26069 2.2607 0.0%
YosemiteTemps Loss_val 0.00095 0.00095 0.0%
YosemiteTemps MAE 1.45187 1.45187 -0.0%
YosemiteTemps RMSE 2.16721 2.16721 0.0%
YosemiteTemps Loss 0.00066 0.00066 0.0%
YosemiteTemps time 131.187 100.26 -23.57% 🎉
PeytonManning MAE_val 0.58159 0.58159 -0.0%
PeytonManning RMSE_val 0.72216 0.72216 0.0%
PeytonManning Loss_val 0.01239 0.01239 -0.0%
PeytonManning MAE 0.41671 0.41671 -0.0%
PeytonManning RMSE 0.55961 0.55961 0.0%
PeytonManning Loss 0.00612 0.00612 0.0%
PeytonManning time 16.0709 12.31 -23.4% 🎉
Model training plots

Model Training

PeytonManning

YosemiteTemps

AirPassengers

@codecov-commenter
Copy link

codecov-commenter commented Apr 11, 2023

Codecov Report

Merging #1256 (4e52aff) into main (347f783) will decrease coverage by 0.01%.
The diff coverage is 88.23%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main    #1256      +/-   ##
==========================================
- Coverage   89.63%   89.62%   -0.01%     
==========================================
  Files          35       35              
  Lines        4938     4953      +15     
==========================================
+ Hits         4426     4439      +13     
- Misses        512      514       +2     
Impacted Files Coverage Δ
neuralprophet/df_utils.py 94.59% <86.66%> (-0.21%) ⬇️
neuralprophet/forecaster.py 88.48% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@judussoari judussoari changed the title [minor] Allow lagged regressors with only unique values for global normalization [minor] Allow lagged regressors with only unique values for global modeling Apr 11, 2023
* No regressor drop if df check is called by make_future_dataframe()
* Test Integration
* No regressor drop if df check is called by make_future_dataframe()
* Test Integration
@judussoari judussoari added the status: needs review PR needs to be reviewed by Reviewer(s) label Apr 11, 2023
@ourownstory ourownstory requested review from leoniewgnr and removed request for ourownstory April 12, 2023 20:43
Copy link
Collaborator

@leoniewgnr leoniewgnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@leoniewgnr
Copy link
Collaborator

Would it be good to write a test because the code covarage is below the target?

@leoniewgnr leoniewgnr added status: needs update PR has outstanding comment(s) or PR test(s) that need to be resolved and removed status: needs review PR needs to be reviewed by Reviewer(s) labels Apr 13, 2023
# Conflicts:
#	neuralprophet/forecaster.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs update PR has outstanding comment(s) or PR test(s) that need to be resolved
Projects
None yet
4 participants