Skip to main content

SpML: Spatial Machine Learning

Continuous Integration codecov PyPI version Conda Version DOI Discord SPEC 0 — Minimum Supported Dependencies

Spatial modeling based on scikit-learn.

The aim of the package is to provide implementations of spatially-explicit modelling.

Features

At the moment, spml provides a framework for prototyping geographically weighted extensions of regression and classification models based on scikit-learn and libpysal.graph and a subset of models implemented on top of this framework. For example, you can run geographically weighted linear regression in a following manner.

import geopandas as gpd
from geodatasets import get_path

from spml.linear_model import GWLinearRegression


gdf = gpd.read_file(get_path('geoda.guerry'))

adaptive = GWLinearRegression(
    bandwidth=25,
    fixed=False,
    kernel='bisquare'
)
adaptive.fit(
    gdf[['Crm_prp', 'Litercy', 'Donatns', 'Lottery']],
    gdf["Suicids"],
    geometry=gdf.representative_point(),
)

For details, see the documentation.

Status

Current development status is beta. The core API of the package should not change without a warning and a proper deprecation cycle. However, minor breaking changes may still occur.

Installation

You can install spatial ML from PyPI or from conda-forge using the tool of your choice:

pip install spml

Or from conda-forge:

conda install spml -c conda-forge

Bug reports

To search for or report bugs, please see the Github issue tracker.

Get in touch

If you have a question regarding spml, feel free to open an issue or join a chat on Discord.

License

The package is licensed under BSD 3-Clause License (Copyright (c) 2025, Martin Fleischmann & PySAL Developers)

Funding

Charles University logo

Charles University’s Primus programme through the project "Influence of Socioeconomic and Cultural Factors on Urban Structure in Central Europe", project reference PRIMUS/24/SCI/023.

Release files for spml 0.2.2

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

Source distribution (sdist)

Source distribution for spml 0.2.2
File Size Uploaded
spml-0.2.2.tar.gz 2.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for spml 0.2.2
File Interpreter ABI Platform
spml-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 2.3 MB

Release files / spml-0.2.2.tar.gz

Download URL spml-0.2.2.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
3412e5bf2bb03fa2ef2a19ea1f71b87a25209a3455cfd291e0c8c7326ee08dde
BLAKE2b-256 checksum
How to use checksums
d77c37260aa9049bac193a86d683bdfa7f1998426cc0fdf50ae8dc1f5357426e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.

Transparency log

Release files / spml-0.2.2-py3-none-any.whl

Download URL spml-0.2.2-py3-none-any.whl
Size 54.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eabc76566d590756bc73e6b0a79f83d7ffcf23fbd2c94677b7d18af7105ea92b
BLAKE2b-256 checksum
How to use checksums
7e3063d1d4c4d88d70f57e4a11aaecd08de58815b37bbb7d8fedf7084f96adad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

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