Skip to main content

Optimal Transport metrics for evaluating spatiotemporal predictions

Project description

Paper Tests

GEOT: A spatially explicit framework for evaluating spatio-temporal predictions

This repo contains code to evaluate spatiotemporal predictions with Optimal Transport (OT). In contrast to standard evaluation metrics (MSE, MAE etc), the OT error is a spatial metric that evaluates the spatial distribution of the errors.

Alt text

Install

First, install a suitable torch version. Then, install the package via pypi:

pip install geot

Or from source:

git clone https://github.com/mie-lab/geospatialOT.git
cd geospatialOT
conda create -n geot_env
conda activate geot_env
pip install .

Explanation of usage:

  • Assume we want to predict some observations in several locations, e.g., bike sharing demand at bike sharing stations, over time
  • Usually, the error is just averaged over locations (MSE between GT and prediction)
  • However, in real-world applications, there are distance-based costs involved with prediction errors. For example, prediction errors cause costs for relocating bikes
  • Assue we can define a cost matrix with the pairwise costs between locations, indicating the cost to account for errors
  • With Optimal Transport, we can compute the minimum costs for transforming the predictions to the ground truth - a better indicator for the real-world costs of prediction errors than just the MSE

With this code, you can compute the OT error for your predictions. The input is usually just the observations at a set of location, the predictions and the cost matrix. The output is the OT error (a single number) or the optimal transport matrix T.

Tutorial

Check out our tutorial to get started with a simple example.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geot-0.1.0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geot-0.1.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file geot-0.1.0.tar.gz.

File metadata

  • Download URL: geot-0.1.0.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.18

File hashes

Hashes for geot-0.1.0.tar.gz
Algorithm Hash digest
SHA256 220577ef3581d6c1012211ff7f28a85f1227a0190f01c8be6ce3cc4f15299a8f
MD5 d88cd25ea2cb2e32c29d2a8f7844ab76
BLAKE2b-256 7a2653994c4f65b765e6d027ffcebf674f9906055d1437476bffa1a6e5037a1b

See more details on using hashes here.

File details

Details for the file geot-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: geot-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.18

File hashes

Hashes for geot-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fdbcfcc06fd303af88645f0b9812f3d70dc04c14266a17c95f247ec034c745e9
MD5 d4e9671488b76f5f0ebb498f22e29e41
BLAKE2b-256 69eea7a82bcaee3795c84dcd40dd2166ed456ac47ab29156f67aaec52aa7d2b2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page