Skip to main content

A package for spatial clustering and analysis

Project description

spatial-cluster-helper

A helper package for analyzing and visualizing spatial clusters, designed to facilitate reproducibility and ease of use in academic and applied research contexts. Developed in support of Anselin (2024).

📦 Features

Cluster Analysis & Validation

  • Cluster Statistics: Generate labels/cardinality summaries (cluster_stats)
  • Fit Metrics: TSS, WSS, BSS, and cluster quality ratios (cluster_fit)
  • Stress Evaluation: Raw/normalized stress values (stress_value)
  • Optimal Clusters: Elbow plot visualization for K-means (elbow_plot)
  • Silhouette Analysis: Observation-level silhouette scores (plot_silhouette)

Spatial Analysis Tools

  • Validation Indices:
    • Fragmentation (entropy/Simpson) (cluster_fragmentation)
    • Spatial autocorrelation (Join Count Ratios) (cluster_joincount)
    • Compactness & diameter metrics (cluster_compactness, cluster_diameter)
  • Neighborhood Overlap: KNN coverage comparison (common_coverage)

Visualization

  • Cluster Maps: Geographic cluster visualization (cluster_map)
  • Dendrograms: Hierarchical clustering trees (plot_dendrogram)
  • Scatter Plots: 2D cluster visualization (plot_scatter)

Utilities

  • Cluster Centers: Mean/median descriptors (cluster_center)
  • Data Management: Automated example datasets handling (ensure_datasets)

🚀 Installation

You can install the package from pypi:

pip install spatial-cluster-helper

🗂️ Usage

You can check several usage examples in the lab materials developed for the Spatial Cluster Analysis course taught at the University of Chicago in the Winter of 2025 here.

📄 License

This project is licensed under the MIT License.


Developed at The Center for Spatial Data Science at the University of Chicago by Luc Anselin and Pedro Amaral

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spatial_cluster_helper-0.1.4.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spatial_cluster_helper-0.1.4-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file spatial_cluster_helper-0.1.4.tar.gz.

File metadata

  • Download URL: spatial_cluster_helper-0.1.4.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for spatial_cluster_helper-0.1.4.tar.gz
Algorithm Hash digest
SHA256 4918b1d7460aa2974f2934b4df2f404b07869d3ec217d790967a5ed3a1ad9dcf
MD5 107a687646291c9893955573b015583d
BLAKE2b-256 669645eea220bb7554b7f21bbbbd9dfc39148c249bf2d6f329a5608273ded41e

See more details on using hashes here.

File details

Details for the file spatial_cluster_helper-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for spatial_cluster_helper-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7dd54c27caf5a34afabeea1a3894011944a2677b5df2028ee2a5eddd87a41479
MD5 b049c257c87b9216b70fcd82e3238ac2
BLAKE2b-256 0047f3ef6c1ebbd8e7816d7e56cba965392e00bf23265acddb5d315f5a007096

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page