Skip to main content

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). Then, all the signal sequences close to the Gaussian mean and of length at least $\Delta t$ 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 frame 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.

Metadata

Release files for tropea-clustering 2.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tropea-clustering 2.1.2
File Size Uploaded
tropea_clustering-2.1.2.tar.gz 38.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for tropea-clustering 2.1.2
File Interpreter ABI Platform
tropea_clustering-2.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 39.0 MB

Release files / tropea_clustering-2.1.2.tar.gz

Download URL tropea_clustering-2.1.2.tar.gz
Size 38.8 MB
Tags Source
SHA-256 checksum
How to use checksums
8e0f3456265266470e68fc687fcfb084351423fc01b468f1d00f545fd762c067
BLAKE2b-256 checksum
How to use checksums
d1d1872d39fc07c56a723cb4bb73beb9276cb42d433c2020735744f04ddcd7c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.4

Release files / tropea_clustering-2.1.2-py3-none-any.whl

Download URL tropea_clustering-2.1.2-py3-none-any.whl
Size 166.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e66e85ad5b3547dffa10cf15cc9318e19363f2eaca15048874961b6f330413e
BLAKE2b-256 checksum
How to use checksums
b38ed8585ad73f33fcfac64d0b49bda6101964cd86c391d35cb11f1a56081847
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.4

Release history Release notifications | RSS feed

This release

2.1.2 This release

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.0.13

2 release files

1.0.11

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

1 release file

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page