Skip to content

pysal/spatialml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

162 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spatial ML

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, spatialml 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 spatialml.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 spatialml

Or from conda-forge:

conda install spatialml -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 spatialml, 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.

About

Spatial modelling based on scikit-learn

Resources

License

Contributing

Stars

Watchers

Forks

Contributors

Languages