spopt.region.SA3¶
- class spopt.region.SA3(gdf, w, attrs_name, min_cluster_size=15, extraction='eom', **kwargs)[source]¶
Spatial Adaptive Agglomerative Aggregation (SA3) clustering.
The algorithm carries out
sklearn.cluster.AgglometariveClusteringper the specified parameters and extracts clusters from it, using density-clustering extraction algorithms - Excess of Mass or Leaf. This results in multiscale, contiguous clusters with noise.- Parameters:
- gdf
geopandas.GeoDataFrame Geodataframe containing original data.
- w
libpysal.weights.W|libpysal.graph.Graph Weights or Graph object created from given data.
- attrs_name
list Strings for attribute names (cols of
geopandas.GeoDataFrame).- min_cluster_size
int The minimum number of observations to form a cluster.
- extraction: str (default “eom”)
The cluster extraction scheme. “eom” is Excess of Mass, “leaf” is Leaf extraction.
- **kwargs
Additional keyword arguments to be used in
sklearn.cluster.AgglometariveClustering.
- gdf
- Attributes:
- labels_
numpy.array Cluster labels for observations.
- labels_
Methods
__init__(gdf, w, attrs_name[, ...])solve()Compute the labels.