reichlab / zoltr

http://reichlab.io/zoltr/
GNU General Public License v3.0
2 stars 4 forks source link

Add function to guarantee that values in prob must be within +/- 0.001 of 1 before uploading #20

Open Khoale1096 opened 4 years ago

Khoale1096 commented 4 years ago

Forecasts produced by some models have values in prob that exceed the +/- 0.001 of 1 set by Zoltar.

Example: real-time forecasts by FluX_ARLR (https://github.com/FluSightNetwork/cdc-flusight-ensemble/blob/master/model-forecasts/real-time-component-models/FluX_ARLR/EW42-2019-FluX_ARLR.csv). Zoltar return an error message when tried to upload this file: RuntimeError: For one prediction element, the values within prob must sum to 1.0. prob_sum=1.0013000000000016.

We would like a function in zoltr that:

Check all prediction elements to make sure that all values in prob sum to within the allowable bound of +/- 0.001 of 1, as set by Zoltar. If there are prediction elements where the values in prob sum to greater than 1.001 or lower than 0.999, perform normalization so that their prob sum stay within bound, and notify the uploader.

mzorn-58 commented 3 years ago

@nickreich @Khoale1096 Can this issue be closed?

Khoale1096 commented 3 years ago

This issue was created as a part of this other issue. I would need to retry uploading the forecasts that were having this probability value issues to see if it was resolved before closing this. If not, this would need to be implemented.

I expect this to be a day of work, but can be tied in as part of the 1 week of work I expect for the previously mentioned issue