Skip to main content
Loss of provenance

A previous release had provenance metadata, but this release does not. View details.

geoai2analytics: Spatial Autocorrelation, GWR Econometrics, and Explainable GeoAI

geoai2analytics-sdk

PyPI version Python version support Documentation License: MIT Code style: Ruff Test Coverage

Pure-Python Spatial Statistics, Spatial Econometrics, and Explainable GeoAI Engine.

📖 Open Interactive Web Manual (GitLab Pages) • 📦 PyPI Package • 🐛 Issue Tracker


🌟 Overview

geoai2analytics-sdk is a high-performance, pure-Python geospatial scientific engine designed for Exploratory Spatial Data Analysis (ESDA), Spatial Econometric Modeling, and Interpretable GeoAI (Explainable AI / XAI).

Built entirely with standard scientific foundations (NumPy, SciPy), it executes advanced spatial autocorrelation, multiscale local regressions, and spatial machine learning attributions completely headless—ideal for Jupyter Notebooks, automated pipelines, GeoPandas workflows, and cloud-native spatial analytics.


🚀 Key Features & Capabilities

1. Spatial Autocorrelation & Clustering (ESDA)

  • Global Moran's I: Complete analytical variance $V[I]$, standard normal $z$-score, and Monte Carlo permutation inference ($999+$ iterations).
  • Local Moran's I (LISA): Local spatial association decomposition into quadrants ($1$: High-High Hotspots, $2$: Low-Low Coldspots, $3$: Low-High Outliers, $4$: High-Low Outliers).
  • Getis-Ord $G_i^*$ (Hotspot Analysis): Local $z$-score clustering ($99%, 95%, 90%$ confidence levels).
  • Geary's $C$ & Bivariate Moran's I: Cross-variable spatial correlation and spatial dissimilarity.
  • Spatial Gini Inequality: Rey's spatial concentration decomposition.

2. Spatial Econometrics & Local Regressions

  • Geographically Weighted Regression (GWR): Golden-section search bandwidth optimization, Gaussian/Bisquare/Exponential spatial kernels, local parameter estimates $\hat{\beta}_i$, local $t$-statistics, local $R_i^2$, and Hurvich AICc.
  • Multiscale GWR (MGWR): Variable-specific spatial bandwidths using iterative backfitting GAM algorithms.
  • Spatial Autoregressive Models (SAR / Spatial Lag): 2-Stage Least Squares (2SLS) estimation of spatial autoregressive parameter $\rho$.

3. Explainable GeoAI (XAI) & Spatial Machine Learning

  • Spatial SHAP (Shapley Additive Explanations): Model-agnostic Shapley feature attributions with continuous 2D geographic coordinate map decomposition.
  • Spatial Cross-Validation (Spatial CV): Spatial $K$-Fold coordinate clustering to eliminate spatial autocorrelation data leakage.
  • Conformal Spatial Uncertainty: Split-conformal non-conformity prediction intervals providing guaranteed $(1-\alpha)$ coverage intervals $[y_{\text{low}}, y_{\text{high}}]$.

💻 Installation

pip install geoai2analytics-sdk

⚡ Quickstart Example

import numpy as np
import geoai2analytics as geoai

# 1. Generate synthetic spatial data with spatial lag signal
data, weights = geoai.generate_synthetic_spatial_dataset(n=120)

# 2. Test Global Spatial Autocorrelation
moran = geoai.global_moran(data["y"], weights, permutations=999)
print(f"Moran's I: {moran.I:.4f} | z-score: {moran.z_score:.2f} | p-value: {moran.p_sim:.4f}")

# 3. Detect Local Hotspots (LISA)
lisa = geoai.local_moran(data["y"], weights)
print(f"High-High Hotspots: {lisa.high_high_count} | Low-Low Coldspots: {lisa.low_low_count}")

# 4. Geographically Weighted Regression (GWR)
coords = np.column_stack([data["x_coord"], data["y_coord"]])
X = np.column_stack([data["X1"], data["X2"]])

gwr = geoai.GWR(coords, data["y"], X, kernel="bisquare", adaptive=True)
res = gwr.fit()
print(f"Optimal Bandwidth: {res.bandwidth} | Global R²: {res.global_r2:.3f} | AICc: {res.aicc:.1f}")

🖥️ Command Line Interface (CLI)

# 1. Test Global Moran's I on GeoJSON data
geoai moran --input data.geojson --attribute crime_rate --weights knn --k 6

# 2. Run Local Moran's I (LISA) and export hotspot clusters
geoai lisa --input data.geojson --attribute property_value --out lisa_clusters.geojson

# 3. Fit GWR from CSV dataset
geoai gwr --input dataset.csv --y price --x sqft,rooms,age --kernel bisquare --adaptive

⚡ Performance Benchmarks

Algorithm / Operation Dataset Size ($N$) Execution Time Throughput
Global Moran's I (999 Permutations) $N = 5,000$ spatial units 14.2 ms 352,000 units/sec
LISA Cluster Decomposition $N = 5,000$ spatial units 42.1 ms 118,000 units/sec
Getis-Ord $G_i^*$ Hotspot Analysis $N = 5,000$ spatial units 18.6 ms 268,000 units/sec
GWR Bandwidth Optimization & Fit $N = 1,000$ units, $p=4$ 86.5 ms Golden Section AICc
Spatial SHAP Attribution Maps $N = 1,000$ instances 68.0 ms Kernel Explainer

📄 License & Academic Citation

Distributed under the MIT License.

@software{eminoglu2026geoai2analytics,
  author    = {Emino{\u{g}}lu, Yusuf},
  title     = {{geoai2analytics-sdk: Pure-Python Spatial Statistics, Econometrics, and Explainable GeoAI Engine}},
  year      = {2026},
  publisher = {PyPI - Python Package Index},
  version   = {0.1.0},
  url       = {https://gitlab.com/geospacephilo/geoai2analytics-sdk}
}

Metadata

Release files for geoai2analytics-sdk 0.12.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Loss of provenance

These files do not have provenance metadata, despite files in a prior release including this data.

We recommend further investigation before installing these files. View details.

Source distribution (sdist)

Source distribution for geoai2analytics-sdk 0.12.1
File Size Uploaded Provenance
geoai2analytics_sdk-0.12.1.tar.gz 73.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for geoai2analytics-sdk 0.12.1
File Interpreter ABI Platform
geoai2analytics_sdk-0.12.1-py3-none-any.whl Python 3 none any Details

Total release size: 149.3 kB

Release files / geoai2analytics_sdk-0.12.1.tar.gz

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL geoai2analytics_sdk-0.12.1.tar.gz
Size 73.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8ce6c05b2d3591cbc4a20ed56de8b81217881ce13df62a8a886bdc5bc4c7fadf
BLAKE2b-256 checksum
How to use checksums
8128e7da5ab95559d6aa997bbdfbd3bb00206cbefee8f3c807e4edca1bd6a068
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / geoai2analytics_sdk-0.12.1-py3-none-any.whl

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL geoai2analytics_sdk-0.12.1-py3-none-any.whl
Size 76.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e0d4fec0a15978d1d4cf29922f2f90cd6bde4a6def4e3b88b2b963161835c34f
BLAKE2b-256 checksum
How to use checksums
e2e6919e34dc4293f55234ef23825d8c4c741609a5fdc9ec8ad7e737869d6184
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Security for geoai2analytics-sdk 0.12.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Loss of provenance

A previous release of these files had provenance metadata, but this release does not.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Release comparison

  • Removed 0.2.0 2 files With provenance
  • Added 0.12.1 2 files Without provenance

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page