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.
This PR adds a more polished version of the COI preservation calculations over in coi-states to the evaluation suite.
TODO
Usage
The COI preservation updater assumes that COIs (or COI aggregations, a.k.a. geoclusters) and dual graph units can be (approximately) represented with a common block unit. Typically, this common unit is the 2020 U.S. Census block. Updaters are specialized to a particular set of COIs and a particular dual graph.
Example: preservation of Wisconsin geoclusters
Suppose
wisconsin_clusters.csv
is a table of geoclusters generated by the pipeline in coi-states. We can load 2020 Census block approximations of the geoclusters as follows:(To compute the preservation of individual COI submissions instead of geoclusters, simply swap in a submission-level dataset with a
blocks_2020
column.)An exact correspondence between 2020 Census blocks and 2020 Census VTDs can similarly be loaded from the official Census block assignment files (BAFs). We expect that the same node identifier is used in the dual graph and in the VTD-block calculations, so it may be necessary to map between Census GeoIDs and node indices.
Block total populations (
P1_001N
) can be retrieved via the Census API.Then, we can generate a COI preservation updater over a range of preservation thresholds: