Methodology
Technical details on data ingestion, schema design, modeling, and analysis guardrails.
- Source-specific adapters for each city (HTML scraping, CSV parsing, PDF extraction)
- Timestamped immutable snapshots at each stage (raw → staging → derived)
- Deterministic incident IDs generated from source fields (no random components)
- Pydantic schema validation at each pipeline stage
- Canonical tables:
incident, subject, officer (linked by incident_id)
- Document corpus linked by
incident_id where available
- Audit fields on every row:
source_name, source_row_id, parser_version, parse_confidence
| Setting |
Value |
| Algorithm |
Logistic regression (scikit-learn) |
| Features |
18 situational variables (city, force type, weapon, armed status, etc.) |
| Target |
Subject fatality (binary) |
| Split |
75/25 stratified random |
| Evaluation |
ROC AUC, average precision, balanced accuracy |
| Bootstrap |
1,000 samples for confidence intervals |
| Cross-validation |
Leave-one-city-out for transportability |
- Controls-only model vs controls+race model on same split
- Paired bootstrap for ROC AUC delta
- Standardization: predict fatality for full sample assigned each race while holding controls fixed
- Post-treatment sensitivity: removes
armed_actual, armed_perceived, weapon_group, shots_fired
- First-listed officer used as proxy (not guaranteed shooter)
- Pairing model adds both subject and officer race indicators
- Same paired comparison methodology
- Minimum stable cell size: 30 rows (cells below flagged “unstable”)
- Subgroups below threshold reported but marked, not hidden
- Post-treatment variables explicitly identified and sensitivity-tested
- No causal claims: conditional pattern analysis only
- Does not recover full denominator of police-civilian encounters
| Component |
Tool |
| Language |
Python 3.11+ |
| ML |
scikit-learn (logistic regression) |
| Data |
Pandas, PyArrow (Parquet), DuckDB |
| Parsing |
Beautiful Soup, lxml, pdftotext |
| Validation |
Pydantic |
| Testing |
pytest with fixture-backed tests |
| Dependencies |
UV package manager |