Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

No project description provided

Project description

PoI Clustering with Stay Points/Stay Region Detection

Python implementation of PoI (Point-of-Interest) clustering algorithm based on:

  • Yang Ye, Yu Zheng, Yukun Chen, Jianhua Feng, and Xing Xie. 2009. Mining Individual Life Pattern Based on Location History. In Proceedings of the 2009 Tenth International Conference on Mobile Data Management: Systems, Services and Middleware (MDM '09).
  • Raul Montoliu, Jan Blom, and Daniel Gatica-Perez. 2013. Discovering Places of Interest in Everyday Life from Smartphone Data. Multimedia Tools And Applications, 62, 1, 179-207.
  • Vincent W. Zheng, Yu Zheng, Xing Xie, and Qiang Yang. 2010. Collaborative Location and Activity Recommendations with GPS History Data. In Proceedings of the 19th International Conference on World Wide Web (WWW '10).

To find PoI, those studies propose a stay point, that is a micro cluster of temporal-spatial trajectories, and a stay region, that is a macro cluster of stay points.

Simple Description of Algorithm

  • Find stay points regarding temporal and spatial distance between two trajectories.
  • Build grids that embodying stay points.
  • Cluster neighboring grids and give labels.


pip install poi-clustering

How to Use

This implementation follows scikit-learn's grammar; fit and predict. For more details, please see docstrings in codes.

import numpy as np
from poi import PoiCluster

# Dummy data of gps coordinates
latlon = np.column_stack([np.random.normal(36, 0.5, 100), np.random.normal(128, 0.5, 100)])
latlon_radian = np.radians(latlon)
timestamps = np.arange(latlon.shape[0])
cluster = PoiCluster(d_max=250, r_max=500, t_max=60, t_min=5), timestamps=timestamps)
label = cluster.predict(latlon_radian)

Project details

Download files

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

Files for poi-clustering, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size poi_clustering-0.0.3-py3-none-any.whl (5.2 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size poi-clustering-0.0.3.tar.gz (4.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page