{"id":13526479,"url":"https://github.com/predict-idlab/tsflex","last_synced_at":"2025-05-16T14:08:48.930Z","repository":{"id":37013516,"uuid":"386663484","full_name":"predict-idlab/tsflex","owner":"predict-idlab","description":"Flexible time series feature extraction \u0026 processing","archived":false,"fork":false,"pushed_at":"2024-09-06T09:28:23.000Z","size":29253,"stargazers_count":417,"open_issues_count":32,"forks_count":26,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-15T15:52:25.396Z","etag":null,"topics":["data-science","feature-engineering","feature-extraction","multimodal","multivariate","pandas","processing","python","time-series","window-stride"],"latest_commit_sha":null,"homepage":"https://predict-idlab.github.io/tsflex/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/predict-idlab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["jonasvdd","jvdd"]}},"created_at":"2021-07-16T14:23:32.000Z","updated_at":"2025-05-13T23:40:26.000Z","dependencies_parsed_at":"2024-02-12T10:28:36.436Z","dependency_job_id":"07ffc3a8-e2f3-44ac-a56d-c46c70778c45","html_url":"https://github.com/predict-idlab/tsflex","commit_stats":{"total_commits":631,"total_committers":8,"mean_commits":78.875,"dds":0.5958795562599049,"last_synced_commit":"4340b650ee647ce9c83a574a916c414988545824"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/predict-idlab%2Ftsflex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/predict-idlab%2Ftsflex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/predict-idlab%2Ftsflex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/predict-idlab%2Ftsflex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/predict-idlab","download_url":"https://codeload.github.com/predict-idlab/tsflex/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254544146,"owners_count":22088807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-science","feature-engineering","feature-extraction","multimodal","multivariate","pandas","processing","python","time-series","window-stride"],"created_at":"2024-08-01T06:01:30.403Z","updated_at":"2025-05-16T14:08:43.920Z","avatar_url":"https://github.com/predict-idlab.png","language":"Python","readme":"# \u003cp align=\"center\"\u003e \u003ca href=\"https://predict-idlab.github.io/tsflex\"\u003e\u003cimg alt=\"tsflex\" src=\"https://raw.githubusercontent.com/predict-idlab/tsflex/main/docs/_static/logo.png\" width=\"66%\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n[![PyPI Latest Release](https://img.shields.io/pypi/v/tsflex.svg)](https://pypi.org/project/tsflex/)\n[![Conda Latest Release](https://img.shields.io/conda/vn/conda-forge/tsflex?label=conda)](https://anaconda.org/conda-forge/tsflex)\n[![support-version](https://img.shields.io/pypi/pyversions/tsflex)](https://img.shields.io/pypi/pyversions/tsflex)\n[![codecov](https://img.shields.io/codecov/c/github/predict-idlab/tsflex?logo=codecov)](https://codecov.io/gh/predict-idlab/tsflex)\n[![CodeQL](https://github.com/predict-idlab/tsflex/actions/workflows/codeql.yml/badge.svg)](https://github.com/predict-idlab/tsflex/actions/workflows/codeql.yml)\n[![Downloads](https://static.pepy.tech/badge/tsflex)](https://pepy.tech/project/tsflex)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?)](http://makeapullrequest.com)\n[![Documentation](https://github.com/predict-idlab/tsflex/actions/workflows/deploy-docs.yml/badge.svg)](https://github.com/predict-idlab/tsflex/actions/workflows/deploy-docs.yml)\n[![Testing](https://github.com/predict-idlab/tsflex/actions/workflows/test.yml/badge.svg)](https://github.com/predict-idlab/tsflex/actions/workflows/test.yml)\n[![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?logo=discord\u0026logoColor=white)](https://discord.gg/k2d59GrxPX)\n\n\n\u003c!-- ![Downloads](https://img.shields.io/conda/dn/conda-forge/tsflex?logo=anaconda) --\u003e\n\n\u003e _tsflex_ is a toolkit for _**flex**ible **t**ime **s**eries_ [processing](https://predict-idlab.github.io/tsflex/processing) \u0026 [feature extraction](https://predict-idlab.github.io/tsflex/features), that is efficient and makes few assumptions about sequence data.\n\n#### Useful links\n\n- [Paper](https://www.sciencedirect.com/science/article/pii/S2352711021001904)\n- [Documentation](https://predict-idlab.github.io/tsflex/)\n- [Example (machine learning) notebooks](https://github.com/predict-idlab/tsflex/tree/main/examples)\n\n#### Installation\n\n|                                                      | command                               |\n| :--------------------------------------------------- | :------------------------------------ |\n| [**pip**](https://pypi.org/project/tsflex/)          | `pip install tsflex`                  |\n| [**conda**](https://anaconda.org/conda-forge/tsflex) | `conda install -c conda-forge tsflex` |\n\n## Usage\n\n_tsflex_ is built to be intuitive, so we encourage you to copy-paste this code and toy with some parameters!\n\n### \u003ca href=\"https://predict-idlab.github.io/tsflex/features/#getting-started\"\u003eFeature extraction\u003c/a\u003e\n\n```python\nimport pandas as pd; import numpy as np; import scipy.stats as ss\nfrom tsflex.features import MultipleFeatureDescriptors, FeatureCollection\nfrom tsflex.utils.data import load_empatica_data\n\n# 1. Load sequence-indexed data (in this case a time-index)\ndf_tmp, df_acc, df_ibi = load_empatica_data(['tmp', 'acc', 'ibi'])\n\n# 2. Construct your feature extraction configuration\nfc = FeatureCollection(\n    MultipleFeatureDescriptors(\n          functions=[np.min, np.mean, np.std, ss.skew, ss.kurtosis],\n          series_names=[\"TMP\", \"ACC_x\", \"ACC_y\", \"IBI\"],\n          windows=[\"15min\", \"30min\"],\n          strides=\"15min\",\n    )\n)\n\n# 3. Extract features\nfc.calculate(data=[df_tmp, df_acc, df_ibi], approve_sparsity=True)\n```\n\nNote that the feature extraction is performed on multivariate data with varying sample rates.\n| signal | columns | sample rate |\n|:-------|:-------|------------------:|\n| df_tmp | [\"TMP\"]| 4Hz |\n| df_acc | [\"ACC_x\", \"ACC_y\", \"ACC_z\" ]| 32Hz |\n| df_ibi | [\"IBI\"]| irregularly sampled |\n\n### \u003ca href=\"https://predict-idlab.github.io/tsflex/processing/index.html#getting-started\"\u003eProcessing\u003c/a\u003e\n\n[Working example in our docs](https://predict-idlab.github.io/tsflex/processing/index.html#working-example)\n\n## Why tsflex? ✨\n\n- `Flexible`:\n  - handles multivariate/multimodal time series\n  - versatile function support\n    =\u003e **integrates** with many packages for:\n    - processing (e.g., [scipy.signal](https://docs.scipy.org/doc/scipy/reference/tutorial/signal.html), [statsmodels.tsa](https://www.statsmodels.org/stable/tsa.html#time-series-filters))\n    - feature extraction (e.g., [numpy](https://numpy.org/doc/stable/reference/routines.html), [scipy.stats](https://docs.scipy.org/doc/scipy/reference/tutorial/stats.html), [antropy](https://raphaelvallat.com/antropy/build/html/api.html), [nolds](https://cschoel.github.io/nolds/nolds.html#algorithms), [seglearn](https://dmbee.github.io/seglearn/feature_functions.html)¹, [tsfresh](https://tsfresh.readthedocs.io/en/latest/text/list_of_features.html)¹, [tsfel](https://tsfel.readthedocs.io/en/latest/descriptions/feature_list.html)¹)\n  - feature extraction handles **multiple strides \u0026 window sizes**\n- `Efficient`:\u003cbr\u003e\n  - view-based operations for processing \u0026 feature extraction =\u003e extremely **low memory peak** \u0026 **fast execution time**\u003cbr\u003e\n    - see: [feature extraction benchmark visualization](https://predict-idlab.github.io/tsflex/#benchmark)\n- `Intuitive`:\u003cbr\u003e\n  - maintains the sequence-index of the data\n  - feature extraction constructs interpretable output column names\n  - intuitive API\n- `Few assumptions` about the sequence data:\n  - no assumptions about sampling rate\n  - able to deal with multivariate asynchronous data\u003cbr\u003ei.e. data with small time-offsets between the modalities\n- `Advanced functionalities`:\n  - apply [FeatureCollection.**reduce**](https://predict-idlab.github.io/tsflex/features/index.html#tsflex.features.FeatureCollection.reduce) after feature selection for faster inference\n  - use **function execution time logging** to discover processing and feature extraction bottlenecks\n  - embedded [SeriesPipeline](http://predict-idlab.github.io/tsflex/processing/#tsflex.processing.SeriesPipeline.serialize) \u0026 [FeatureCollection](https://predict-idlab.github.io/tsflex/features/index.html#tsflex.features.FeatureCollection.serialize) **serialization**\n  - time series [**chunking**](https://predict-idlab.github.io/tsflex/chunking/index.html)\n\n¹ These integrations are shown in [integration-example notebooks](https://github.com/predict-idlab/tsflex/tree/main/examples).\n\n## Future work 🔨\n\n- scikit-learn integration for both processing and feature extraction\u003cbr\u003e\n  **note**: is actively developed upon [sklearn integration](https://github.com/predict-idlab/tsflex/tree/sklearn_integration) branch.\n- Support time series segmentation (exposing under the hood strided-rolling functionality) - [see this issue](https://github.com/predict-idlab/tsflex/issues/15)\n- Support for multi-indexed dataframes\n\n=\u003e Also see the [enhancement issues](https://github.com/predict-idlab/tsflex/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement+)\n\n## Contributing 👪\n\nWe are thrilled to see your contributions to further enhance `tsflex`.\u003cbr\u003e\nSee [this guide](CONTRIBUTING.md) for more instructions on how to contribute.\n\n## Referencing our package\n\nIf you use `tsflex` in a scientific publication, we would highly appreciate citing us as:\n\n```bibtex\n@article{vanderdonckt2021tsflex,\n    author = {Van Der Donckt, Jonas and Van Der Donckt, Jeroen and Deprost, Emiel and Van Hoecke, Sofie},\n    title = {tsflex: flexible time series processing \\\u0026 feature extraction},\n    journal = {SoftwareX},\n    year = {2021},\n    url = {https://github.com/predict-idlab/tsflex},\n    publisher={Elsevier}\n}\n```\n\nLink to the paper: https://www.sciencedirect.com/science/article/pii/S2352711021001904\n\n---\n\n\u003cp align=\"center\"\u003e\n👤 \u003ci\u003eJonas Van Der Donckt, Jeroen Van Der Donckt, Emiel Deprost\u003c/i\u003e\n\u003c/p\u003e\n","funding_links":["https://github.com/sponsors/jonasvdd","https://github.com/sponsors/jvdd"],"categories":["Code-Resource","Libraries","📦 Packages","Related Software"],"sub_categories":["2020","Python","Time-Series Analysis"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpredict-idlab%2Ftsflex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpredict-idlab%2Ftsflex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpredict-idlab%2Ftsflex/lists"}