Algorithms for analyzing the stability of spatial clusters over time
Project description
stco
A Python package for assessing the temporal stability of spatial clustering methods via spatial overlay analysis.
Introduction
Typically, to look at hotspots of point patterns we might aggregate the points to polygons and use a method like LISA or Getis-Ord Gi* to find cold and hot spots. With clustering methods like A-DBSCAN, or any other clustering method that removes noise, we can produce cluster footprints to show "hotspots." There are existing ways to examine the spatial stability of clusters (e.g., A-DBSCAN), but what about looking at temporal stability of clusters and how they change over time? Methods like ST-DBSCAN incorporate the temporal dimension directly into the clustering algorithm, which slighly differs from what we are trying to accomplish here, since we want to look at change over time rather then clustering over both space and time. This leads to the question of, is there a way to study the temporal stability of clusters and explore emerging hotspots, in a way similar to that of Esri's Space Time Cube, without having to aggregate the data? The answer is yes, through stco.
stco seeks to provide a very simple way to analyze spatial clusters over time with the help of overlay analysis, one of the fundamental operations of GIScience. Rather than runnning clustering directly on the spatiotemporal data, we run spatial clustering on periods of time (by subsetting the data and taking "snapshots") of the spatiotemporal data to produce clusters for each time step. After this, a simple or weighted overlay can be used to examine how clusters change over time. In addition, through the STCEC method, cluster overlays can be classified according to the characteristics of the temporal pattern of cluster recognition in a given area.
Installation
To install stco from PyPI, use the following command.
pip install stco
stco has been tested in Python 3.9, 3.10, and 3.11, and support for 3.12 is expected to work and will be tested in the near future. stco depends on the following packages:
esdageopandasnumbanumpypandasshapelytqdm
There are also additional dependencies for development. A comprehensive list of the recommended dependencies and the version used in development can be found in the requirements.txt file.
Examples & Documentation
For examples, refer to the examples folder within the repository, which contains several notebooks.
For documentation, refer to the examples folder as well as the source code in the stco folder. In order to view documentation through the Python REPL or a notebook, you can use the following code on any given function, class, or method.
from stco.clustering import SnapshotADBSCAN
from stco.overlay import simple_overlay, stcec, weighted_overlay
help(SnapshotADBSCAN)
help(simple_overlay)
help(weighted_overlay)
help(stcec)
Project details
Release history Release notifications | RSS feed
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 stco-0.1.2.tar.gz.
File metadata
- Download URL: stco-0.1.2.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3ad523e401d879759d6cc41d5551e55a43f1bf7be93e23457cd00d345ffce80
|
|
| MD5 |
bc8ca513004684ed4ccd632727afc60d
|
|
| BLAKE2b-256 |
4caf765b78dc65718053b564d4b42a8dc1a188774c496aa1a2840e8e011d3732
|
File details
Details for the file stco-0.1.2-py3-none-any.whl.
File metadata
- Download URL: stco-0.1.2-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb5d4f05160b58d43ed3e6e1c05fe9c0ed7765be3c30aebec88b04d37e080adb
|
|
| MD5 |
e246e3f2ad79d5505f4ad1dcdf144e34
|
|
| BLAKE2b-256 |
72f34c1736f797b6c6a59f7610514a317c997290d770c381c4c846126bd12977
|