Skip to content

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():

python
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 from N and D (weighting / CI).

Multi-select filters accept either a single value or a list. Omitted fields fall back to the listed default.

Geofence filters

FilterTypeAffectsDefaultOptionsDescription
outcomesingle-selectnpolice_reportedpolice_reported: Police-reported
observed_any_injury: Any reported injury
airbag: Any airbag deployment
ego_airbag: Ego airbag deployment
ka: Serious+ (K or A)
fatal: Fatal (K)
What kind of crash to count. Each outcome is a subset of police-reported.
severityintn11: 1
2: 2
3: 3
4: 4
5: 5
6: 6
7: 7
Minimum CRIS vehicle-damage rating (1–7) a unit must have to be counted. Ignored for SF (SWITRS records no damage rating).
under_reportingsingle-selectnnonenone: 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_transportsingle-selectnin_transportin_transport: In-transport only
include_all: Include parked
Whether to exclude parked vehicles (Vehicle Parked Flag).
ego_vehiclemulti-selectbothcars, light_truckscars: Cars
light_trucks: Light trucks
heavy_trucks: Heavy trucks
motorcycles: Motorcycles
buses: Buses
other: Other
Vehicle classes to count and to size the exposure denominator against.
unresolved_nfssingle-selectbothmarginalmarginal: Use observed class share
none: Exclude
all: Include at full weight
How to treat units whose vehicle class could not be resolved (NFS tier 3).
road_typemulti-selectbotharterial, collector_localinterstate: Interstate
other_freeway: Other freeway / expressway
arterial: Arterial
collector_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_weightingsingle-selectratecounty_widecounty_wide: County-wide
operator_weighted: Operator-weighted (dynamic)
Plain county-wide Σ/Σ rate, or the Chen 2024 operator-weighted spatial multiplier (needs Waymo rider-only mileage).
multiplier_vmtsingle-selectratecalibratedcalibrated: 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_vmtsingle-selectdcalibratedcalibrated: 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.
weathermulti-selectbothdry, rain, fogany: Any
dry: Dry
rain: Rain
fog: Fog
winter_storm: Winter storm
Weather buckets (NOAA-derived). 'any' disables the filter.
light_conditionmulti-selectbothanyany: Any
daylight: Daylight
dawn_dusk: Dawn / dusk
dark: Dark
Ambient-light buckets. 'any' disables the filter.
crash_yearint (multi)n20222022: 2022
2023: 2023
2024: 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

FilterTypeAffectsDefaultOptionsDescription
outcomesingle-selectnpolice_reportedpolice_reported: Police-reported
observed_any_injury: Any reported injury
airbag: Any airbag deployment
ego_airbag: Ego airbag deployment
ka: Serious+ (K or A)
fatal: Fatal (K)
What kind of crash to count. Each outcome is a subset of police-reported.
severityintn11: 1
2: 2
3: 3
4: 4
5: 5
6: 6
7: 7
Minimum CRIS vehicle-damage rating (1–7) a unit must have to be counted. Ignored for SF (SWITRS records no damage rating).
under_reportingsingle-selectnnonenone: 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_transportsingle-selectnin_transportin_transport: In-transport only
include_all: Include parked
Whether to exclude parked vehicles (Vehicle Parked Flag).
ego_vehiclemulti-selectbothcombinationcars: Cars
light_trucks: Light trucks
combination: Combination trucks (Class 8 / tractor-trailer)
motorcycles: Motorcycles
buses: Buses
other: Other
Vehicle classes to count and to size the exposure denominator against.
unresolved_nfssingle-selectbothmarginalmarginal: Use observed class share
none: Exclude
all: Include at full weight
How to treat units whose vehicle class could not be resolved (NFS tier 3).
weathermulti-selectbothdry, rain, fogany: Any
dry: Dry
rain: Rain
fog: Fog
winter_storm: Winter storm
Weather buckets (NOAA-derived). 'any' disables the filter.
light_conditionmulti-selectbothanyany: Any
daylight: Daylight
dawn_dusk: Dawn / dusk
dark: Dark
Ambient-light buckets. 'any' disables the filter.
driver_impairmentsingle-selectnanyany: Any
exclude_impaired: Exclude impaired
impaired_only: Impaired only
Filter by driver-impairment coding. Route and depot modes only.
ci_methodsingle-selectratefay_feuerfay_feuer: Fay-Feuer (weighted Poisson)
empirical_bayes: Empirical Bayes (Gamma-Poisson)
Method for the 95% CI in route / depot modes.

Depot filters

FilterTypeAffectsDefaultOptionsDescription
outcomesingle-selectnpolice_reportedpolice_reported: Police-reported
observed_any_injury: Any reported injury
airbag: Any airbag deployment
ego_airbag: Ego airbag deployment
ka: Serious+ (K or A)
fatal: Fatal (K)
What kind of crash to count. Each outcome is a subset of police-reported.
severityintn11: 1
2: 2
3: 3
4: 4
5: 5
6: 6
7: 7
Minimum CRIS vehicle-damage rating (1–7) a unit must have to be counted. Ignored for SF (SWITRS records no damage rating).
under_reportingsingle-selectnnonenone: 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_transportsingle-selectnin_transportin_transport: In-transport only
include_all: Include parked
Whether to exclude parked vehicles (Vehicle Parked Flag).
ego_vehiclemulti-selectbothcombinationcars: Cars
light_trucks: Light trucks
combination: Combination trucks (Class 8 / tractor-trailer)
motorcycles: Motorcycles
buses: Buses
other: Other
Vehicle classes to count and to size the exposure denominator against.
unresolved_nfssingle-selectbothmarginalmarginal: Use observed class share
none: Exclude
all: Include at full weight
How to treat units whose vehicle class could not be resolved (NFS tier 3).
weathermulti-selectbothdry, rain, fogany: Any
dry: Dry
rain: Rain
fog: Fog
winter_storm: Winter storm
Weather buckets (NOAA-derived). 'any' disables the filter.
light_conditionmulti-selectbothanyany: Any
daylight: Daylight
dawn_dusk: Dawn / dusk
dark: Dark
Ambient-light buckets. 'any' disables the filter.
driver_impairmentsingle-selectnanyany: Any
exclude_impaired: Exclude impaired
impaired_only: Impaired only
Filter by driver-impairment coding. Route and depot modes only.
ci_methodsingle-selectrateempirical_bayesfay_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.

Derived statistics only. Attribute every published figure. Maintained by Valgo.