Skip to content

Conversation

@nmdefries
Copy link
Contributor

@nmdefries nmdefries commented Mar 17, 2023

Description

Various changes to make modeling/predicting faster. The main changes are:

  • Keep date fields (time_value, issue_date) in string format. Explicitly convert to date when required. This reduces the (large) number of implicit date-to-string conversions happening in other functions.
  • Replace zoo::rollmeanr with RcppRoll::roll_mean for speed. Unlike most other fast rolling average functions available in R (e.g. stats::filter), RcppRoll::roll_mean uses the same more-precise method as zoo; the speedup is only because the new function is implemented in C++.

Modeling with these changes is 20% faster than after #1802 changes and 33% faster overall. The test example is smaller than what would be used in production.

@nmdefries nmdefries requested a review from jingjtang March 17, 2023 16:06
@nmdefries nmdefries marked this pull request as ready for review March 17, 2023 16:06
Copy link
Contributor

@jingjtang jingjtang left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@jingjtang jingjtang left a comment

Choose a reason for hiding this comment

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

LGTM

@nmdefries
Copy link
Contributor Author

@korlaxxalrok This is ready to merge

@nmdefries
Copy link
Contributor Author

@krivard This is ready to merge

@krivard krivard merged commit a065d3d into main Mar 27, 2023
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

Successfully merging this pull request may close these issues.

4 participants