washingtonpost / elex-live-model

a model to generate estimates of the number of outstanding votes on an election night based on the current results of the race
48 stars 5 forks source link

Small agg model bug #99

Closed lennybronner closed 2 months ago

lennybronner commented 2 months ago

Description

As part of the hunt for the 2023 agg model bug we identified a different, smaller bug that effects the intervals only (not the point prediction). On occasion the double sampling can create intervals that are slightly too wide.

We max the agg model predictions with the number of contests won by the LHS party since that is the minimum number of contests that party can win. We also min with the number of contests won by the RHS party since that is the maximum number they can win.

Also small change to finding the uncalled races to avoid floating point issues.

Jira Ticket

https://arcpublishing.atlassian.net/browse/ELEX-4453

Test Steps

python run.py 2023-11-07_VA_G redo --office_id Y --geographic_unit_type county-district --pi_method bootstrap --estimands "['margin']" --features "['baseline_normalized_margin']" --start_timestamp "2023-11-07 19:00:00+01:00" --current_run_name va-y-test --percent_ev_threshold 95 --agg_model_preds --base_to_add 20

in the testbed