geoai2analytics-sdk
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}
}
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file geoai2analytics_sdk-0.12.0.tar.gz.
File metadata
- Download URL: geoai2analytics_sdk-0.12.0.tar.gz
- Upload date:
- Size: 73.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4e3a30bf3db817f410d83bfe5ab990423247a52aa0d1897c12ace87e4de2b5d
|
|
| MD5 |
5eb1608bd648c08ea59571c99a4af9f9
|
|
| BLAKE2b-256 |
760a1feb45aa95fe34f8e8d9fd8b3d5fce642828b28a58c3ec441a7f3baf9c2c
|
File details
Details for the file geoai2analytics_sdk-0.12.0-py3-none-any.whl.
File metadata
- Download URL: geoai2analytics_sdk-0.12.0-py3-none-any.whl
- Upload date:
- Size: 76.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13b9cc045a36b2c075aa6002168308403039f2c030db1fa4ddfa9232bf8383e9
|
|
| MD5 |
d2b8ef5d48cddefd891bb773c0514e8a
|
|
| BLAKE2b-256 |
f4472a8c83ae55f61eba65735c71181e03b5fa4bef6865175f0bae552faf4016
|