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

Meta name bool #997

Merged
merged 11 commits into from
Dec 2, 2022
Merged

Meta name bool #997

merged 11 commits into from
Dec 2, 2022

Conversation

alfonsogarciadecorral
Copy link
Collaborator

@ourownstory

This simple PR is to reduce some lines the global-local logic.

A boolean variable called meta_name_bool will be used if we need to know the time series ID when we interact with the Model.

Which is the best release I should add this to?

@github-actions
Copy link

github-actions bot commented Nov 28, 2022

853e987

Model Benchmark

Benchmark Metric main current diff
YosemiteTemps MAE_val 1.72949 1.72948 -0.0%
YosemiteTemps RMSE_val 2.27386 2.27386 -0.0%
YosemiteTemps Loss_val 0.00096 0.00096 -0.0%
YosemiteTemps RegLoss_val 0 0 0.0%
YosemiteTemps epoch 84 84 0.0%
YosemiteTemps MAE 1.45189 1.45189 -0.0%
YosemiteTemps RMSE 2.16631 2.16631 -0.0%
YosemiteTemps Loss 0.00066 0.00066 0.0%
YosemiteTemps RegLoss 0 0 0.0%
YosemiteTemps time 106.89 157.02 46.9% ⚠️
PeytonManning MAE_val 0.64636 0.64636 -0.0%
PeytonManning RMSE_val 0.79276 0.79276 -0.0%
PeytonManning Loss_val 0.01494 0.01494 -0.0%
PeytonManning RegLoss_val 0 0 0.0%
PeytonManning epoch 37 37 0.0%
PeytonManning MAE 0.42701 0.42701 0.0%
PeytonManning RMSE 0.57032 0.57032 -0.0%
PeytonManning Loss 0.00635 0.00635 0.0%
PeytonManning RegLoss 0 0 0.0%
PeytonManning time 12.65 18.46 45.93% ⚠️
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 RegLoss_val 0 0 0.0%
AirPassengers epoch 89 89 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 RegLoss 0 0 0.0%
AirPassengers time 4.97 7.48 50.5% ⚠️
Model training plots

Model Training

PeytonManning

YosemiteTemps

AirPassengers

@codecov-commenter
Copy link

codecov-commenter commented Nov 28, 2022

Codecov Report

Merging #997 (af2d5fb) into main (8e39a4a) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #997      +/-   ##
==========================================
+ Coverage   89.89%   89.91%   +0.01%     
==========================================
  Files          18       19       +1     
  Lines        4653     4649       -4     
==========================================
- Hits         4183     4180       -3     
+ Misses        470      469       -1     
Impacted Files Coverage Δ
neuralprophet/forecaster.py 88.02% <100.00%> (+0.01%) ⬆️
neuralprophet/time_net.py 90.01% <100.00%> (+0.16%) ⬆️
neuralprophet/plot_forecast_plotly.py 86.82% <0.00%> (-0.77%) ⬇️
neuralprophet/utils.py 81.08% <0.00%> (-0.34%) ⬇️
neuralprophet/configure.py 90.15% <0.00%> (-0.31%) ⬇️
neuralprophet/plot_model_parameters_matplotlib.py 90.50% <0.00%> (-0.24%) ⬇️
neuralprophet/df_utils.py 94.72% <0.00%> (ø)
neuralprophet/plot_utils.py 89.77% <0.00%> (ø)

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

@noxan noxan added the status: needs review PR needs to be reviewed by Reviewer(s) label Nov 30, 2022
Copy link
Collaborator

@karl-richter karl-richter left a comment

Choose a reason for hiding this comment

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

Love the change, thanks for simplifying the implementation!

@karl-richter
Copy link
Collaborator

@alfonsogarciadecorral not sure if this needs to be added to a specific release, from my side this is more of a refactoring we can always merge into the master. @noxan what do you think?

@karl-richter karl-richter added status: ready PR is ready to be merged and removed status: needs review PR needs to be reviewed by Reviewer(s) labels Nov 30, 2022
@karl-richter karl-richter added this to the Release 0.5.0 milestone Nov 30, 2022
Copy link
Collaborator

@noxan noxan left a comment

Choose a reason for hiding this comment

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

LGTM overall, like the removal of duplicate code. I've added two suggestions, should be quick fixes for better readability - we can merge it with any upcoming release.

neuralprophet/forecaster.py Outdated Show resolved Hide resolved
@@ -705,6 +705,9 @@ def fit(self, df, freq="auto", validation_df=None, progress="bar", minimal=False
# When only one time series is input, self.id_list = ['__df__']
self.num_trends_modelled = len(self.id_list) if self.config_trend.trend_global_local == "local" else 1
self.num_seasonalities_modelled = len(self.id_list) if self.config_season.global_local == "local" else 1
self.meta_name_bool = (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not really sure what meta_name_bool stands for, could we come up with some more clear naming? For example meta_use_df_name or something similar?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree, for me its also not really clear what meta_name is referring to.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, I agree!
What about:

  • meta_used_in_forward
  • model_uses_meta
    ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

What exactly is meta even referring to? Its the name of the local dataset in case global / local modelling is used, correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, the dataloader has meta in it, including the 'ID' of the local dataset.
When doing global/local modeling we need to know the 'ID' of each sample on the batch.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

changed it to meta_used_in_model - Didn't add "name" on it as this could be used as well once we have static covariates, for example

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for the improvement @alfonsogarciadecorral - I find the meta naming of this functionality rather unclear, but that is not related to your work - I'll open a follow up issue on that.

Co-authored-by: Richard Stromer <noxan@users.noreply.github.com>
Copy link
Collaborator

@noxan noxan left a comment

Choose a reason for hiding this comment

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

LGTM - create the follow up issue separately

@noxan noxan merged commit 853e987 into main Dec 2, 2022
@noxan noxan deleted the mata-name-bool branch December 2, 2022 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready PR is ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants