In order to get the upcoming bootstrap model working I had to make changes to how the Featurizer works. But these changes need to be compatible with our nonparametric and gaussian models. This PR is only for the necessary changes to the Featurizer and changes in the BaseElectionModel to work with the new Featurizer (and unit test changes).
Beyond centering and scaling the features and adding an intercept, the core problem that the Featurizer needed to deal with was generating fixed effects. Specifically that fixed effects in the fitting data might not appear in the holdout data and fixed effect values in the holdout data might not appear in the fitting data.
In the past we manually added and subtracted the columns. Instead we now generate the fixed effects for all units and instead differentiate between expanded fixed effects (all fixed effects that haven't been dropped to avoid multicolinearity) and active fixed effects (expanded fixed effects that appear in the fitting data).
Description
In order to get the upcoming bootstrap model working I had to make changes to how the
Featurizer
works. But these changes need to be compatible with our nonparametric and gaussian models. This PR is only for the necessary changes to the Featurizer and changes in theBaseElectionModel
to work with the new Featurizer (and unit test changes).Beyond centering and scaling the features and adding an intercept, the core problem that the Featurizer needed to deal with was generating fixed effects. Specifically that fixed effects in the fitting data might not appear in the holdout data and fixed effect values in the holdout data might not appear in the fitting data.
In the past we manually added and subtracted the columns. Instead we now generate the fixed effects for all units and instead differentiate between expanded fixed effects (all fixed effects that haven't been dropped to avoid multicolinearity) and active fixed effects (expanded fixed effects that appear in the fitting data).
Jira Ticket
Test Steps
These commands should still work as expected:
also
tox
for unit tests