xrspatial.classify.head_tail_breaks#

xrspatial.classify.head_tail_breaks(agg: DataArray, name: str | None = 'head_tail_breaks') DataArray[source]#

Classify data using the Head/Tail Breaks algorithm.

Iteratively partitions data around the mean. Values below the mean form a class, and values above continue to be split until the head proportion exceeds 40%.

Parameters:
  • agg (xr.DataArray or xr.Dataset) – 2D NumPy, CuPy, NumPy-backed Dask, or CuPy-backed Dask array of values to be classified.

  • name (str, default='head_tail_breaks') – Name of output aggregate array.

Returns:

head_tail_agg – 2D aggregate array of head/tail break classifications. All other input attributes are preserved. If agg is a Dataset, returns a Dataset with each variable classified independently.

Return type:

xr.DataArray or xr.Dataset

References