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

ELEX-2758-generalize-param-input #64

Closed rishasurana closed 1 year ago

rishasurana commented 1 year ago

Description

We deal with all model parameters that get passed into get_estimates the same way, independent of what model they are actually for (non-parameter, gaussian). Instead we should pass a dictionary of additional model parameters (or model settings?) to get_estimates that specify the parameters that are specific to the model pi_method.

These are: beta : gaussian winsorize : gaussian robust : nonparametric lambda_ should also be passed in that way (though can be run with either model)

Jira Ticket

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

Test Steps

tox

AC

  1. get_estimates should receive a dictionary with model parameters (ie. the model parameters above)
  2. Update _check_input_parameters to make sure that the parameters are included in the specific model.
  3. Update election calls (in unit tests, etc.)

Notes

Added C901 after AC #2. The model_parameters checks can be moved to another function if we want to keep this flag.