Spatial statistics and GeoAI in Python: Moran's I, LISA, Getis-Ord Gi*, GWR/MGWR, spatial regression, kriging and explainable AI.
pip install geoai2analytics-sdk==0.12.4 Copy PIP instructions
📖 Open Interactive Web Manual • 📦 PyPI Package • 🐙 GitHub • 🐛 Issue Tracker
pip install geoai2analytics-sdk # core: NumPy only pip install "geoai2analytics-sdk[geo]" # + SciPy, Shapely, GeoPandas, scikit-learn pip install "geoai2analytics-sdk[dev]" # + test, lint, typing and packaging tools The core SDK does not import the geo packages; they are only for downstream GeoDataFrame workflows and complementary modelling. Requirements: Python 3.9+ and NumPy 1.22+. No compiler, GDAL, or system geometry library is required.
import numpy as np import geoai2analytics as geoai data, weights = geoai.generate_synthetic_spatial_dataset(n=120) # built-in demo data 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}") lisa = geoai.local_moran(data["y"], weights) print(f"High-High Hotspots: {lisa.high_high_count} | Low-Low Coldspots: {lisa.low_low_count}") coords = np.column_stack([data["x_coord"], data["y_coord"]]) X = np.column_stack([data["X1"], data["X2"]]) res = geoai.GWR(coords, data["y"], X, kernel="bisquare", adaptive=True).fit() print(f"Optimal Bandwidth: {res.bandwidth} | Global R²: {res.global_r2:.3f} | AICc: {res.aicc:.1f}") # Moran's I: 0.3478 | z-score: 7.32 | p-value: 0.0010 # High-High Hotspots: 12 | Low-Low Coldspots: 8 # Optimal Bandwidth: 24.0 | Global R²: 0.967 | AICc: 810.3 🌟 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 on standard scientific foundations (NumPy and the Python standard library), 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.
The package ships 75+ public algorithms with a single, consistent NumPy-first API, no compiled extensions, and no mandatory geo-stack dependency.
git clone https://github.com/YusufEminoglu/geoai2analytics-sdk.git cd geoai2analytics-sdk python -m pip install -e ".[dev]" Verify the installation import geoai2analytics as geoai print(geoai.__version__) data, weights = geoai.generate_synthetic_spatial_dataset(n=50) print(len(data["y"]), weights.n) 🧪 Usage Examples Spatial weights and hotspot analysis import numpy as np import geoai2analytics as geoai coords = np.random.default_rng(0).uniform(0, 100, size=(150, 2)) y = np.random.default_rng(1).normal(size=150) # Distance-band bisquare weights (rows are standardized by default) w = geoai.distance_band_weights(coords, threshold=25.0, kernel="bisquare") moran = geoai.global_moran(y, w, permutations=499) hotspots = geoai.local_getis_ord_gi_star(y, w) print(moran.summary()) print("99% hotspots:", hotspots.hotspot_count_99) Spatial econometrics (SAR / SEM / GWR) import numpy as np import geoai2analytics as geoai data, weights = geoai.generate_synthetic_spatial_dataset(n=200) coords = np.column_stack([data["x_coord"], data["y_coord"]]) X = np.column_stack([data["X1"], data["X2"]]) y = np.asarray(data["y"]) sar = geoai.fit_spatial_lag(y, X, weights, covariate_names=["income", "density"]) print(f"rho={sar.rho:.3f} R²={sar.r2:.3f}") sem = geoai.fit_spatial_error(y, X, weights) print(f"lambda={sem.lambda_param:.3f} AIC={sem.aic:.1f}") gwr = geoai.GWR(coords, y, X, kernel="bisquare", adaptive=True) gwr_res = gwr.fit() print(gwr_res.summary()) Explainable GeoAI and uncertainty import numpy as np import geoai2analytics as geoai rng = np.random.default_rng(7) X = rng.normal(size=(120, 3)) y = 3.0 * X[:, 0] - 2.0 * X[:, 1] + 0.5 * X[:, 2] + rng.normal(scale=0.2, size=120) def predict_fn(matrix: np.ndarray) -> np.ndarray: return 3.0 * matrix[:, 0] - 2.0 * matrix[:, 1] + 0.5 * matrix[:, 2] explainer = geoai.SpatialSHAP( predict_fn=predict_fn, background_data=X[:40], feature_names=["income", "density", "age"], nsamples=40, ) shap_result = explainer.explain(X[:10]) print(shap_result.summary()) report = geoai.calibrate_spatial_conformal( y_calib_pred=predict_fn(X[:60]), y_calib_actual=y[:60], y_test_pred=predict_fn(X[60:]), y_test_actual=y[60:], alpha=0.05, ) print(report.to_dict()) Spatio-temporal emerging hotspots import numpy as np import geoai2analytics as geoai rng = np.random.default_rng(11) coords = rng.uniform(0, 100, size=(40, 2)) matrix = rng.normal(10, 2, size=(40, 8)) matrix[:8, :] += np.arange(8) * 2.0 # emerging trend cube = geoai.SpaceTimeCube(coords, matrix, time_labels=[f"T{t}" for t in range(8)]) result = geoai.emerging_hotspot_analysis(cube) print(result.pattern_summary) print(result.to_dict()["global_spacetime_moran_i"]) Clustering and regionalization import numpy as np import geoai2analytics as geoai rng = np.random.default_rng(3) coords = np.vstack([ rng.normal(loc=[15, 15], scale=2, size=(30, 2)), rng.normal(loc=[80, 80], scale=2, size=(30, 2)), ]) dbscan = geoai.cluster_spatial_points_dbscan(coords, eps_distance=8.0, min_samples=4) hdbscan = geoai.cluster_spatial_hdbscan(coords, min_cluster_size=8) print(dbscan.to_dict()) print(hdbscan.to_dict()) 🖥️ Command Line Interface (CLI) Installing the package exposes the geoai2analytics console script.
# 1. Show version and capability information geoai2analytics info # 2. Generate a synthetic spatially autocorrelated dataset geoai2analytics synthetic --n 120 --out synthetic.json # 3. Run Global & Local Moran's I on the built-in synthetic dataset geoai2analytics test-moran # 4. Print help and available subcommands geoai2analytics --help 🔌 Public API Reference All symbols below are importable directly from geoai2analytics.
# Run the test suite python -m pytest -q # Run with coverage (configured in pyproject.toml) python -m pytest -q --cov=geoai2analytics --cov-report=term-missing # Format and lint python -m ruff format src tests python -m ruff check . The repository targets Python 3.9–3.13 and enforces Ruff formatting/linting. All public functions and dataclasses carry type hints and docstrings, and the test suite covers algorithmic results as well as edge/error paths.
@software{eminoglu2026geoai2analytics, author = {Emino{\u{g}}lu, Yusuf}, title = {{geoai2analytics-sdk: Pure-Python Spatial Statistics, Econometrics, and Explainable GeoAI Engine}}, year = {2026}, publisher = {Zenodo}, version = {0.12.4}, doi = {10.5281/zenodo.23677244}, url = {https://github.com/YusufEminoglu/geoai2analytics-sdk} } Project links Data verified by PyPI on Nov 7, 2026 Data provided by the project maintainers, verified at the time the release was uploaded to PyPI. Changelog Issues Repository Documentation Homepage Key dates PyPI data Data sourced directly from PyPI's database. Released: Nov 7, 2026 Latest release 1 maintainer PyPI data Data sourced directly from PyPI's database. yusuf.eminoglu Credits Author: Yusuf Eminoğlu
Both files in this release have provenance metadata.
spatial-statistics spatial-econometrics geoai gwr mgwr lisa morans-i spatial-autocorrelation shap xai conformal-prediction spatial-weights gis urban-analytics getis-ord hotspot-analysis kriging spatial-regression geostatistics pysal-alternative
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
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.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.
Both files in this release have been uploaded with provenance metadata.
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Sep 6, 2026 2 release files Loss of provenance




