Skip to main content

Code for unsupervised clustering of time-correlated data.

Project description

tropea_clustering

tropea-clustering (the newest version of onion-clustering) is a Python package for single-point time-series clustering.

Author: Matteo Becchi

Developement history

This version of onion clustering is meant to be used as an external library, and complies with the scikit-learn format. If you are looking for the standalone onion clustering version, you can find it at https://github.com/matteobecchi/timeseries_analysis. However, be aware that the standalone version has been last updated on September, 2024 and is no longer supported or mantained. We reccomand using this version.

Installation

To get tropea-clustering, you can install it with pip

pip install tropea-clustering

The examples/ folder contains examples of usage.

Documentation

https://onion-clustering.readthedocs.io/en/latest/index.html.

Overview

Onion Clustering is an algorithm for single-point clustering of time-series data. It performs the clustering analyses at a specific time-resolution $\Delta t$, which is the minimum lifetime required for a cluster to be characterized as a stable environment. The clustering proceeds in an iterative way. At each iteration, the maximum of the cumulative distribution of data points is identified as a Gaussian state (meaning, a state characterized by the mean value and the variance of the signal inside it). The time-series signals are sliced in consecutive windows of duration $\Delta t$, and the windows close enough to the state's mean are classified as belonging to that state. These signals are then removed from the analysis, in order to enhance the resolution on the still unclassified signals at the next iteration. At the end of the process each signal windows is thus either classified in one of the identified states, or labelled as "unclassified" at that specific time resolution.

Performing this analysis at different values of the time resolution $\Delta t$ allows to automatically identify the optimal choice of $\Delta t$ that maximizes the number of environments correctly separated, and minimizes the fraction of unclassified points. Complete details can be found at https://doi.org/10.1073/pnas.2403771121.

Dependencies

For plotting the results, you will need also

How to cite us

If you use tropea-clustering (or onion-clustering) in your work, please cite https://doi.org/10.1073/pnas.2403771121.

Aknowledgements

We developed this code when working in the Pavan group, https://www.gmpavanlab.com/. Thanks to Andrew Tarzia for all the help with the code formatting and documentation, and to Domiziano Doria, Chiara Lionello and Simone Martino for the beta-testing.

The work was funded by the European Union and ERC under projects DYNAPOL and the NextGenerationEU project.

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

tropea_clustering-1.0.12.tar.gz (96.7 MB view details)

Uploaded Source

Built Distribution

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

tropea_clustering-1.0.12-py3-none-any.whl (36.3 kB view details)

Uploaded Python 3

File details

Details for the file tropea_clustering-1.0.12.tar.gz.

File metadata

  • Download URL: tropea_clustering-1.0.12.tar.gz
  • Upload date:
  • Size: 96.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for tropea_clustering-1.0.12.tar.gz
Algorithm Hash digest
SHA256 2b3bae4c8a4d9b4b8072715a27c14e09d32537677f742bdadab6fe4da4f569db
MD5 8a318a9c16825de2872103f21528eecf
BLAKE2b-256 e92de2c5815ee8efb9c24695b225ed934f4f1baab20fcee8fc9a93094a392f07

See more details on using hashes here.

File details

Details for the file tropea_clustering-1.0.12-py3-none-any.whl.

File metadata

File hashes

Hashes for tropea_clustering-1.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 16d5ea8de9a6560a0e7f4db3c82e37ae1488ffa38495d0461bc87f7ccc43d629
MD5 8fa117934a10833e99fb9c0cc500dcf6
BLAKE2b-256 925ee4df4568ab06c6cca18bb1f9aea2a79c0af9a623bbcaacac7399be7bb117

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