cmu-delphi / epipredict

Tools for building predictive models in epidemiology.
https://cmu-delphi.github.io/epipredict/
Other
8 stars 8 forks source link

fix: #290 #300

Closed dajmcdon closed 3 months ago

dajmcdon commented 3 months ago

Checklist

Please:

Change explanations for reviewer

Magic GitHub syntax to mark associated Issue(s) as resolved when this is merged into the default branch

dajmcdon commented 3 months ago

@dshemetov I think this fixes your issue. This is technically a bug that may be on main. I'm not entirely sure if it (alone) would fix main however (I could not reproduce the NA's on the dev branch, only the incorrect target date).

Update: In testing on main, the NA's remain in .pred_distn if: ahead = 7L and target_date = "2021-01-01". This is not the case on dev, despite the fact that there is a mismatch between forecast_date + ahead and target_date.

It's probably worth adding a check to the *_args_list() constructors to ensure that this isn't misspecified.

dshemetov commented 3 months ago

Hm, there's still an issue when using n_training < ahead in flatline_forecaster, gonna address in another PR.