indicators#

Shared weighted-indicator vocabulary for the vote-based curation steps.

A single predicate language reused by every step that tallies weighted evidence toward a class (resolve_by_vote in reconcilers.py, classify_parcel_land_use in inferers.py): each indicator references existing columns and contributes a boolean vote, so any recipe can mix and match the same vocabulary regardless of which voting step it configures.

Functions#

evaluate_indicator(→ pandas.Series)

Return a boolean Series marking rows that satisfy one voting indicator.

Module Contents#

openplaces.io.curator.indicators.evaluate_indicator(curated: pandas.DataFrame, indicator: dict) pandas.Series#

Return a boolean Series marking rows that satisfy one voting indicator.

Indicators reference columns by name; any referenced column that is absent yields an all-False result, so the indicator simply contributes no votes.

Supported type values:

  • value_share_below: value / sum(total) < max_ratio. With include_zero true, a zero value also matches (covers a zero total).

  • keyword: case-insensitive str.contains(pattern) on column (regex defaults to true; set false for a literal substring match).

  • equals: column equals value.

  • in_set: column value is in values.

  • numeric_at_least (alias count_at_least): column >= min.

  • numeric_at_most: column <= max.

  • any_of: true where any of the nested indicators matches. Lets a backing signal corroborate an existing indicator (e.g. an independent source agreeing with a generic column) without contributing an extra weighted vote of its own – the whole group counts once.