Explicitly interpolate only cols 'x' and 'n'; handle categorical and other columns #849
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi 👋 @daniel-klein
What this PR introduces
This draft PR shows how we have been handling categorical columns (and other columns) that may exist in the dataframes passed to calibration components.
expected
time index, iterate over a list ['x', 'n'] rather than over the list of available columns inactual
.actual
'x' and 'n' columns have been conformed, we handle the other columns.Not sure my proposed solution is optimal if dataframes are large though.
Description
For calibration pipelines using typhoidsim, our 'extraction' functions that generate dataframes for calibration components, include a couple of other columns, in addition to the expected 'x' and 'n'.
For our specific use case each dataframe has one single row, representing a "single time point", which is really a time bin (or year bin). As time index we use the halfway point of the year/time bin, but it's really useful to have a more informative label with the actual boundaries of the bin. That's what we store in the column 'year_bin'.
In addition we have multiple age bins in our target/reference data, and we use one calibration component per age bin.
Storing this categorical information enable us to:
Checklist