Skip to main content

Temporospatial clustering in Python. Well suited for mobility data.

Project description

Infostop

Python package for detecting stop locations in mobility data

This package implements the algorithm described in https://arxiv.org/pdf/2003.14370.pdf, for detecting stop locations in time-ordered location data.

Usage

Given a location trace such as:

>>> data 
array([[ 55.75259295,  12.34353885 ],
       [ 55.7525908 ,  12.34353145 ],
       [ 55.7525876 ,  12.3435386  ],
       ...,
       [ 63.40379175,  10.40477095 ],
       [ 63.4037841 ,  10.40480265 ],
       [ 63.403787  ,  10.4047871  ]])

Or with time information

>>> data 
array([[ 55.75259295,  12.34353885, 1581401760 ],
       [ 55.7525908 ,  12.34353145, 1581402760 ],
       [ 55.7525876 ,  12.3435386 , 1581403760 ],
       ...,
       [ 63.40379175,  10.40477095, 1583401760 ],
       [ 63.4037841 ,  10.40480265, 1583402760 ],
       [ 63.403787  ,  10.4047871 , 1583403760 ]])

A stop location solution can be obtained using:

>>> from infostop import Infostop
>>> model = Infostop()
>>> labels = model.fit_predict(data)

Alternatively, data can also be a list of numpy.arrays, in which case it is assumed that list elements are seperate traces in the same space. In this multi segment (or multi user) case, Infostop finds stop locations that are shared by different segments.

Solutions can be plotted using:

>>> from infostop import plot_map
>>> folmap = plot_map(model)
>>> folmap.m

Plotting this onto a map:

img

For more examples and full documentation check out the documentation page.

Advantages

  • Simplicity: At its core, the method works by two steps. (1) Reducing the location trace to the medians of each stationary event and (2) embedding the resulting locations into a network that connects locations that are within a user-defined distance and clustering that network.
  • Multi-trace support: Currently, no other libraries support clustering multiple traces at once to find global stop locations. Infostop does. The image above visualizes stop locations at a campus for a population of almost 1000 university students.
  • Flow based: Spatial clusters correspond to collections of location points that contain large amounts of flow when represented as a network. This enables the recovery of locations where traces slightly overlap.
  • Speed: First the point space is reduced to the median of stationary points (executed in a fast C++ module), then spatially neighboring points connected using a Ball search tree algorithm, and finally the network is clustered using the C++ based Infomap program. For example, clustering 100.000 location points takes about a second.

Installation

pip install infostop

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

infostop-0.1.8.tar.gz (16.7 kB view details)

Uploaded Source

Built Distributions

infostop-0.1.8-py3.9-linux-x86_64.egg (879.8 kB view details)

Uploaded Source

infostop-0.1.8-py3.8-macosx-10.9-x86_64.egg (96.2 kB view details)

Uploaded Source

infostop-0.1.8-cp38-cp38-macosx_10_9_x86_64.whl (71.8 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

Details for the file infostop-0.1.8.tar.gz.

File metadata

  • Download URL: infostop-0.1.8.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for infostop-0.1.8.tar.gz
Algorithm Hash digest
SHA256 fb651facf719ef3c02988907b31e3226c0485c8666b58ee2c65bfaae5f89e3d8
MD5 652b3210ba6d4d0595ee3b1c24d38b9b
BLAKE2b-256 004a975c689f96b0da42a54667bc59c88b72ce30f6c3260cbe7b57538141cc39

See more details on using hashes here.

File details

Details for the file infostop-0.1.8-py3.9-linux-x86_64.egg.

File metadata

  • Download URL: infostop-0.1.8-py3.9-linux-x86_64.egg
  • Upload date:
  • Size: 879.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for infostop-0.1.8-py3.9-linux-x86_64.egg
Algorithm Hash digest
SHA256 8c5c62f3573dc3db847a7f8e67cc1f29529018eb895bb9a25ed241130bfaf819
MD5 a32b7837cc6a842edb36f8be7d229784
BLAKE2b-256 11938b76026792aacce98f5b7bd7e0577ee87ce752912693d901c38c2dffa1e3

See more details on using hashes here.

File details

Details for the file infostop-0.1.8-py3.8-macosx-10.9-x86_64.egg.

File metadata

  • Download URL: infostop-0.1.8-py3.8-macosx-10.9-x86_64.egg
  • Upload date:
  • Size: 96.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.3

File hashes

Hashes for infostop-0.1.8-py3.8-macosx-10.9-x86_64.egg
Algorithm Hash digest
SHA256 e7cd7847802a4f0b3a6889820e0a900b79506ecea00094147b06ef415cc5521a
MD5 f58c6ad5923c92b0a4e99ed1ed0b68fe
BLAKE2b-256 74714798e0415e6826a179aaff9170b6dfd2310e1751e4b6e0f534477479d324

See more details on using hashes here.

File details

Details for the file infostop-0.1.8-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: infostop-0.1.8-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 71.8 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for infostop-0.1.8-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8a9d18e51bf52e2b9aadc7611dd5a3097654c2e58d273da13bcae2596463694f
MD5 95438a49d6e44afb5d6812b79c227414
BLAKE2b-256 aea22729ea1a17415166079521fb7004fdb93f5f27db37f1fe05ce0f0d816668

See more details on using hashes here.

Supported by

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