-
Notifications
You must be signed in to change notification settings - Fork 0
testing forecasters on simple datasets #32
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
Conversation
I also added the flatline forecaster and made the necessary changes to get that working. Should be ready for review (pending the tests passing on the remote). |
To be clear, the tests this adds are:
|
7a6e0d1
to
b60b500
Compare
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.
Comments are mostly for formatting/structure, still looking at this for content.
There are a lot of objs being printed out, I assume for debugging. Test code should be removed. I marked some of them, probably not all.
Generally, it'd be good to have more descriptive "test_that" names and/or comments about what the goal of a particular test is.
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.
Confused about the reasoning behind a couple of the checks.
Other tests that might be useful to include:
- Which dates predicted values are available for/making sure that preds are on days where we have enough data
- Right now, looks like predictions are only for dates that are included in the input dataset. Might be useful to check behavior when making true forecasts (again, that output dates are what we expect, etc)
mutate( | ||
diff_from_exp = | ||
(value - qnorm(quantile, mean = synth_mean, sd = synth_sd)) / | ||
as.integer(target_end_date - forecast_date) |
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.
question: Why are we normalizing by days ahead?
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.
iirc the variance should be increasing linearly with the number of days into the future? It's probably a complication we don't need to include, since ahead=1
for all of these tests.
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.
the variance should be increasing linearly with the number of days into the future
Oh, I see what you mean. A prediction for ahead_i
will have error within synth_sd
around the prediction for ahead_i - 1
, which also has error. So the error accumulates and is ~bounded by synth_sd * days ahead
for each ahead. Sound approximately correct? 😄
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.
maybe leave this in case we want add more aheads later, but add a comment about the normalization? But no strong feelings on my part.
output date correctness is checked here in the "basics" section, rather than the "data" section: exploration-tooling/tests/testthat/test-forecasters-basics.R Lines 18 to 21 in b60b500
as well as somewhat indirectly in the latency adjusting specific functions:
|
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 for a first pass.
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!
addresses #23 and #20. I ended up not actually using targets for the simple data tests b/c it ended up too awkward and distributed. I should probably do a little cleanup of the repo and check for edge cases before we actually merge this.