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.
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
- matplotlib
- plotly (optional)
- kaleido (optional)
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, CAGEX.
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
Built Distribution
File details
Details for the file tropea_clustering-1.0.5.tar.gz
.
File metadata
- Download URL: tropea_clustering-1.0.5.tar.gz
- Upload date:
- Size: 21.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e170d723f3cda1ffbb1f746775389e1a80fe2095d1245924bf3c35ef378217f |
|
MD5 | 78f9fceaba2920b29ea9cae8c4940f01 |
|
BLAKE2b-256 | ad758ad2b29010cb1435d28beb75e1d7d574c7c90a392c110b8369c7bee9889b |
File details
Details for the file tropea_clustering-1.0.5-py3-none-any.whl
.
File metadata
- Download URL: tropea_clustering-1.0.5-py3-none-any.whl
- Upload date:
- Size: 34.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d70616ddfb226b9af1411c1636ad2af785c6786c8cd219558b55faf40e7de1c4 |
|
MD5 | f87019030f852724fab7829f9739f12d |
|
BLAKE2b-256 | fb0605820219f61f8992a2239f693116cd036a0084526536f2dedb9d94044853 |