Filters
Filters select which crashes count toward the numerator and how the exposure denominator is sized. Pass them as keyword args, a typed Selections model, or a dict (three ways), all validated locally. Each filter applies to one or more compute modes.
Discover, don't hard-code
Filter options and defaults can change as data is added. Fetch them at runtime with filters():
for f in hb.filters().modes["geofence"]:
print(f.id, "→", [o.id for o in f.options], "default:", f.default)This returns, per mode, every filter with its id, label, description, affects (n / d / both / rate), multiselect flag, valid options, and the default for that mode. The tables below are generated from the same source.
How affects reads
n: changes the numerator (which crashes are counted).d: changes the denominator (the exposure miles).both: changes numerator and denominator together (e.g. vehicle class).rate: changes how the rate is derived fromNandD(weighting / CI).
Multi-select filters accept either a single value or a list. Omitted fields fall back to the listed default.
Geofence filters
| Filter | Type | Affects | Default | Options | Description |
|---|---|---|---|---|---|
outcome | single-select | n | police_reported | police_reported: Police-reportedobserved_any_injury: Any reported injuryairbag: Any airbag deploymentego_airbag: Ego airbag deploymentka: Serious+ (K or A)fatal: Fatal (K) | What kind of crash to count. Each outcome is a subset of police-reported. |
severity | int | n | 1 | 1: 12: 23: 34: 45: 56: 67: 7 | Minimum CRIS vehicle-damage rating (1–7) a unit must have to be counted. Ignored for SF (SWITRS records no damage rating). |
under_reporting | single-select | n | none | none: None (unadjusted)adjusted: Adjusted (Blincoe et al. 2023) | Apply Blincoe et al. 2023 NHTSA under-reporting multipliers (PDO ×2.48, non-fatal injury ×1.47, fatal ×1.0). |
in_transport | single-select | n | in_transport | in_transport: In-transport onlyinclude_all: Include parked | Whether to exclude parked vehicles (Vehicle Parked Flag). |
ego_vehicle | multi-select | both | cars, light_trucks | cars: Carslight_trucks: Light trucksheavy_trucks: Heavy trucksmotorcycles: Motorcyclesbuses: Busesother: Other | Vehicle classes to count and to size the exposure denominator against. |
unresolved_nfs | single-select | both | marginal | marginal: Use observed class sharenone: Excludeall: Include at full weight | How to treat units whose vehicle class could not be resolved (NFS tier 3). |
road_type | multi-select | both | arterial, collector_local | interstate: Interstateother_freeway: Other freeway / expresswayarterial: Arterialcollector_local: Collector / local | Functional road classes to include. The dynamic operator multiplier only applies when every selected class is a surface street (arterial / collector_local). |
robo_taxi_weighting | single-select | rate | county_wide | county_wide: County-wideoperator_weighted: Operator-weighted (dynamic) | Plain county-wide Σ/Σ rate, or the Chen 2024 operator-weighted spatial multiplier (needs Waymo rider-only mileage). |
multiplier_vmt | single-select | rate | calibrated | calibrated: Calibrated (TxDOT × VM-4)hpms: HPMS (Chen 2024) | Exposure source used inside the operator-weighted multiplier. Only relevant when robo_taxi_weighting=operator_weighted. |
denominator_vmt | single-select | d | calibrated | calibrated: CPRD (Caltrans)hpms: HPMS (functional class) | Road-mileage dataset for the rate denominator. Effectively California-only: the CA pipelines expose a Caltrans CPRD vs HPMS toggle, whereas Texas/Arizona/Nevada counties have a single state-DOT calibrated denominator and reject 'hpms' with a 400. |
weather | multi-select | both | dry, rain, fog | any: Anydry: Dryrain: Rainfog: Fogwinter_storm: Winter storm | Weather buckets (NOAA-derived). 'any' disables the filter. |
light_condition | multi-select | both | any | any: Anydaylight: Daylightdawn_dusk: Dawn / duskdark: Dark | Ambient-light buckets. 'any' disables the filter. |
crash_year | int (multi) | n | 2022 | 2022: 20222023: 20232024: 2024 | Which year(s) of police-reported crash data feed the numerator. Geofence cities only (their units carry a crash_year column). Selecting multiple years pools their crashes and scales the denominator by the number of years, so the rate stays an annual mean. The listed years are advertised, not county-validated; years absent from a county are silently ignored. |
Route filters
| Filter | Type | Affects | Default | Options | Description |
|---|---|---|---|---|---|
outcome | single-select | n | police_reported | police_reported: Police-reportedobserved_any_injury: Any reported injuryairbag: Any airbag deploymentego_airbag: Ego airbag deploymentka: Serious+ (K or A)fatal: Fatal (K) | What kind of crash to count. Each outcome is a subset of police-reported. |
severity | int | n | 1 | 1: 12: 23: 34: 45: 56: 67: 7 | Minimum CRIS vehicle-damage rating (1–7) a unit must have to be counted. Ignored for SF (SWITRS records no damage rating). |
under_reporting | single-select | n | none | none: None (unadjusted)adjusted: Adjusted (Blincoe et al. 2023) | Apply Blincoe et al. 2023 NHTSA under-reporting multipliers (PDO ×2.48, non-fatal injury ×1.47, fatal ×1.0). |
in_transport | single-select | n | in_transport | in_transport: In-transport onlyinclude_all: Include parked | Whether to exclude parked vehicles (Vehicle Parked Flag). |
ego_vehicle | multi-select | both | combination | cars: Carslight_trucks: Light truckscombination: Combination trucks (Class 8 / tractor-trailer)motorcycles: Motorcyclesbuses: Busesother: Other | Vehicle classes to count and to size the exposure denominator against. |
unresolved_nfs | single-select | both | marginal | marginal: Use observed class sharenone: Excludeall: Include at full weight | How to treat units whose vehicle class could not be resolved (NFS tier 3). |
weather | multi-select | both | dry, rain, fog | any: Anydry: Dryrain: Rainfog: Fogwinter_storm: Winter storm | Weather buckets (NOAA-derived). 'any' disables the filter. |
light_condition | multi-select | both | any | any: Anydaylight: Daylightdawn_dusk: Dawn / duskdark: Dark | Ambient-light buckets. 'any' disables the filter. |
driver_impairment | single-select | n | any | any: Anyexclude_impaired: Exclude impairedimpaired_only: Impaired only | Filter by driver-impairment coding. Route and depot modes only. |
ci_method | single-select | rate | fay_feuer | fay_feuer: Fay-Feuer (weighted Poisson)empirical_bayes: Empirical Bayes (Gamma-Poisson) | Method for the 95% CI in route / depot modes. |
Depot filters
| Filter | Type | Affects | Default | Options | Description |
|---|---|---|---|---|---|
outcome | single-select | n | police_reported | police_reported: Police-reportedobserved_any_injury: Any reported injuryairbag: Any airbag deploymentego_airbag: Ego airbag deploymentka: Serious+ (K or A)fatal: Fatal (K) | What kind of crash to count. Each outcome is a subset of police-reported. |
severity | int | n | 1 | 1: 12: 23: 34: 45: 56: 67: 7 | Minimum CRIS vehicle-damage rating (1–7) a unit must have to be counted. Ignored for SF (SWITRS records no damage rating). |
under_reporting | single-select | n | none | none: None (unadjusted)adjusted: Adjusted (Blincoe et al. 2023) | Apply Blincoe et al. 2023 NHTSA under-reporting multipliers (PDO ×2.48, non-fatal injury ×1.47, fatal ×1.0). |
in_transport | single-select | n | in_transport | in_transport: In-transport onlyinclude_all: Include parked | Whether to exclude parked vehicles (Vehicle Parked Flag). |
ego_vehicle | multi-select | both | combination | cars: Carslight_trucks: Light truckscombination: Combination trucks (Class 8 / tractor-trailer)motorcycles: Motorcyclesbuses: Busesother: Other | Vehicle classes to count and to size the exposure denominator against. |
unresolved_nfs | single-select | both | marginal | marginal: Use observed class sharenone: Excludeall: Include at full weight | How to treat units whose vehicle class could not be resolved (NFS tier 3). |
weather | multi-select | both | dry, rain, fog | any: Anydry: Dryrain: Rainfog: Fogwinter_storm: Winter storm | Weather buckets (NOAA-derived). 'any' disables the filter. |
light_condition | multi-select | both | any | any: Anydaylight: Daylightdawn_dusk: Dawn / duskdark: Dark | Ambient-light buckets. 'any' disables the filter. |
driver_impairment | single-select | n | any | any: Anyexclude_impaired: Exclude impairedimpaired_only: Impaired only | Filter by driver-impairment coding. Route and depot modes only. |
ci_method | single-select | rate | empirical_bayes | fay_feuer: Fay-Feuer (weighted Poisson)empirical_bayes: Empirical Bayes (Gamma-Poisson) | Method for the 95% CI in route / depot modes. |
Mode-specific vehicle classes
Route and depot modes count Class-8 combination trucks (combination) to match the combination-truck exposure denominator, so combination replaces heavy_trucks in those modes.