esda.external_entropy

esda.external_entropy(a, b, balance=0, base=2.718281828459045)[source]

The harmonic mean summarizing the overlay entropy of two sets of polygons: a onto b and b onto a.

Called the v-measure in [Nowosad and Stepinski, 2018]

Parameters:
a : geometry array of polygons

array of polygons

b : geometry array of polygons

array of polygons

balance : float

weight that describing the relative importance of pattern a or pattern b. When large and positive, we weight the measure more to ensure polygons in b are fully contained by polygons in a. When large and negative, we weight the pattern to ensure polygons in A are fully contained by polygons in b. Corresponds to the log of beta in {cite}`Nowosad2018`.

base : float

base of logarithm to use throughout computation

Returns:

  • (n,) array expressing the entropy of the areal distributions

  • of a’s splits by partition b.

Example

>>> import geopandas
>>> from esda import external_entropy
>>> from geodatasets import get_path
>>> ch1 = geopandas.read_file(get_path('geoda.charleston1'))
>>> ch2 = geopandas.read_file(get_path('geoda.charleston2'))
>>> external_entropy(ch1, ch2)
np.float64(0.7941995421208056)