tpcp

tpcp: Tiny Pipelines for Complex Problems - A set of framework independent helpers for algorithms development and evaluation - Published in JOSS (2023)

https://github.com/mad-lab-fau/tpcp

Science Score: 98.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 10 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

algorithms biosignals data-management data-science machine-learning python

Keywords from Contributors

acute-stress amylase biomarkers cortisol ecg-processing health-psychology psychology questionnaires stress-protocols

Scientific Fields

Mathematics Computer Science - 37% confidence
Last synced: 4 months ago · JSON representation ·

Repository

Pipeline and Dataset helpers for complex algorithm evaluation.

Basic Info
Statistics
  • Stars: 18
  • Watchers: 2
  • Forks: 3
  • Open Issues: 12
  • Releases: 56
Topics
algorithms biosignals data-management data-science machine-learning python
Created about 4 years ago · Last pushed 5 months ago
Metadata Files
Readme Changelog License Citation

README.md

PyPI Documentation Status codecov Test and Lint Code style: black PyPI - Downloads DOI

tpcp - Tiny Pipelines for Complex Problems

A generic way to build object-oriented datasets and algorithm pipelines and tools to evaluate them.

Easily install tpcp via pip: bash pip install tpcp

Or add it to your project with poetry: bash poetry add tpcp

Why?

Evaluating Algorithms - in particular when they contain machine learning - is hard. Besides understanding required concepts (cross validation, bias, overfitting, ...), you need to implement the required steps and make them work together with your algorithms and data. If you are doing something "regular" like training an SVM on tabular data, amazing libraries like sklearn, tslearn, pytorch, and many others, have your back. By using their built-in tools (e.g. sklearn.evaluation.GridSearchCV) you prevent implementation errors, and you are provided with a sensible structure to organize your code that is well understood in the community.

However, often the problems we are trying to solve are not regular. They are complex. As an example, here is the summary of the method from one of our recent papers: - We have continuous multi-dimensional sensor recordings from multiple participants from a hospital visit and multiple days at home - For each participant we have global metadata (age, diagnosis) and daily annotations - We want to train a Hidden-Markov-Model that can find events in the data streams - We need to tune hyper-parameters of the algorithm using a participant-wise cross validation - We want to evaluate the final performance of the algorithm for the settings trained on the hospital data -> tested on home data and trained on home data -> tested on home data - Using the same structure we want to evaluate a state-of-the-art algorithm to compare the results

None of the standard frameworks can easily abstract this problem, because here we have none-tabular data, multiple data sources per participant, a non-traditional ML algorithm, and a complex train-test split logic.

With tpcp we want to provide a flexible framework to approach such complex problems with structure and confidence.

How?

To make tpcp easy to use, we try to focus on a couple of key ideas:

  • Datasets are Python classes (think of pytorch.datasets, but more flexible) that can be split, iterated over, and queried.
  • Algorithms and Pipelines are Python classes with a simple run and optimize interface, that can be implemented to fit any problem.
  • Everything is a parameter and everything is optimization: In regular ML we differentiate training and hyper-parameter optimization. In tpcp we consider everything that modifies parameters or weights as an optimization. This allows to use the same concepts and code interfaces from simple algorithms that just require a grid search to optimize a parameter to neuronal network pipelines with hyperparameter tuning.
  • Provide what is difficult, allow to change everything else: tpcp implements complicated constructs like cross validation and grid search and, whenever possible, tries to catch obvious errors in your approach. However, for the actual algorithm and dataset you are free to do whatever is required to solve your current research question.

Should you use tpcp?

Datasets

Yes - the object-oriented Datasets have proven themselves to be a really nice and flexible way to encapsulate Datasets with data from multiple modalities. There is a clear path of integrating lazy-loading, load-cashing, data filtering, or pre-processing on loading. From our experience, even if you ignore all the other tpcp features, Datasets can greatly simplify how you interact with your data sources and can serve as a self-documenting API for your data.

Learn more (Examples)

Other projects using Datasets: - gaitmap-datasets - cold-face-test-analysis - carwatch-analysis - mobgap

Parameter Optimization and Cross Validation

Maybe - All parameter optimization features in tpcp exist to provide a unified API, in case other specific frameworks are too specialised. In cases where all your algorithms can be abstracted by sklearn, pytorch (with the skorch wrapper), tensorflow/Keras (with the scikeras wrapper), or any other framework that provides a nice scikit-learn API, you will get all the features tpcp can provide with much less boilerplate by just using sklearn and optuna directly. Even, if you need to implement completely custom algorithms, we would encourage you to see if you can emulate a sklearn-like API to make use of its vast ecosystem.

This will usually work well for all algorithms that can be abstracted by the fit-predict paradigm. However, for more "traditional" algorithms with no "fit" step or complicated optimizations, the run (with optional self_optimize) API of tpcp might be a better fit. So if you are using or developing algorithms across library domains, that don't all work well with a sklearn API, then Yes, tpcp is a good choice.

Learn more: General Concepts, Custom Algorithms, Parameter Optimization, Cross Validation

Other projects using tpcp features: - gaitmap - uses tpcp as basis for custom class based algorithms - gaitmap-bench - uses all tpcp features (from pipelines to optuna integration) for standardized evaluation of algorithms - eargait - uses tpcp as basis for custom class based algorithms - mobgap - uses tpcp as basis for custom class based algorithms and to implement reproducible evaluation tools

Citation

If you use tpcp in your research, we would appreciate a citation to our JOSS paper. This helps us to justify putting time into maintaining and improving the library.

Küderle et al., (2023). tpcp: Tiny Pipelines for Complex Problems - A set of framework independent helpers for algorithms development and evaluation. Journal of Open Source Software, 8(82), 4953, https://doi.org/10.21105/joss.04953

bibtex @article{ Küderle2023, doi = {10.21105/joss.04953}, url = {https://doi.org/10.21105/joss.04953}, year = {2023}, publisher = {The Open Journal}, volume = {8}, number = {82}, pages = {4953}, author = {Arne Küderle and Robert Richer and Raul C. Sîmpetru and Bjoern M. Eskofier}, title = {tpcp: Tiny Pipelines for Complex Problems - A set of framework independent helpers for algorithms development and evaluation}, journal = {Journal of Open Source Software} }

Contribution

The entire development is managed via GitHub. If you run into any issues, want to discuss certain decisions, want to contribute features or feature requests, just reach out to us by opening a new issue.

Dev Setup

We are using poetry to manage dependencies and poethepoet to run and manage dev tasks.

To set up the dev environment including the required dependencies for using and developing on tpcp run the following commands: bash git clone https://github.com/mad-lab-fau/tpcp cd tpcp poetry install --all-extras

Afterward, you can start to develop and change things. If you want to run tests, format your code, build the docs, ..., you can run one of the following poethepoet commands

CONFIGURED TASKS format format_unsafe lint Lint all files with ruff. ci_check Check all potential format and linting issues. test Run Pytest with coverage. docs Build the html docs using Sphinx. docs_clean Remove all old build files and build a clean version of the docs. docs_preview Preview the built html docs. version

by calling

bash poetry run poe <command name> `

If you installed poethepoet globally, you can skip the poetry run part at the beginning.

Owner

  • Name: Machine Learning and Data Analytics Lab FAU
  • Login: mad-lab-fau
  • Kind: organization
  • Location: Erlangen, Germany

Public projects of the Machine Learning and Data Analytics Lab at the Friedrich-Alexander-University Erlangen-Nürnberg

JOSS Publication

tpcp: Tiny Pipelines for Complex Problems - A set of framework independent helpers for algorithms development and evaluation
Published
February 13, 2023
Volume 8, Issue 82, Page 4953
Authors
Arne Küderle ORCID
Machine Learning and Data Analytics Lab (MaD Lab), Department Artificial Intelligence in Biomedical Engineering (AIBE), Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU)
Robert Richer ORCID
Machine Learning and Data Analytics Lab (MaD Lab), Department Artificial Intelligence in Biomedical Engineering (AIBE), Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU)
Raul C. Sîmpetru ORCID
Neuromuscular Physiology and Neural Interfacing (N-squared) Laboratory, Department Artificial Intelligence in Biomedical Engineering (AIBE), Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU)
Bjoern M. Eskofier ORCID
Machine Learning and Data Analytics Lab (MaD Lab), Department Artificial Intelligence in Biomedical Engineering (AIBE), Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU)
Editor
Adi Sinn ORCID
Tags
Machine Learning Data Analysis

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Küderle"
  given-names: "Arne"
  orcid: "https://orcid.org/0000-0002-5686-281X"
- family-names: "Richer"
  given-names: "Robert"
  orcid: "https://orcid.org/0000-0003-0272-5403"
- family-names: "Sîmpetru"
  given-names: "Raul C."
  orcid: "https://orcid.org/0000-0003-0455-0168"
- family-names: "Eskofier"
  given-names: "Bjoern M."
  orcid: "https://orcid.org/0000-0002-0417-0336"
title: "tpcp: Tiny Pipelines for Complex Problems - A set of framework independent helpers for algorithms development and evaluation"
version: 0.13.0
doi: 10.17605/OSF.IO/GKY2U
url: "https://github.com/mad-lab-fau/tpcp"

preferred-citation:
  type: article
  authors:
    - family-names: "Küderle"
      given-names: "Arne"
      orcid: "https://orcid.org/0000-0002-5686-281X"
    - family-names: "Richer"
      given-names: "Robert"
      orcid: "https://orcid.org/0000-0003-0272-5403"
    - family-names: "Sîmpetru"
      given-names: "Raul C."
      orcid: "https://orcid.org/0000-0003-0455-0168"
    - family-names: "Eskofier"
      given-names: "Bjoern M."
      orcid: "https://orcid.org/0000-0002-0417-0336"
  doi: 10.21105/joss.04953
  journal: "Journal of Open Source Software"
  start: 4953
  title: "tpcp: Tiny Pipelines for Complex Problems - A set of framework independent helpers for algorithms development and evaluation"
  issue: 82
  volume: 8
  year: 2023

GitHub Events

Total
  • Create event: 3
  • Issues event: 3
  • Release event: 3
  • Watch event: 2
  • Delete event: 1
  • Issue comment event: 1
  • Push event: 11
  • Pull request review event: 3
  • Pull request review comment event: 10
  • Pull request event: 3
  • Fork event: 1
Last Year
  • Create event: 3
  • Issues event: 3
  • Release event: 3
  • Watch event: 2
  • Delete event: 1
  • Issue comment event: 1
  • Push event: 11
  • Pull request review event: 3
  • Pull request review comment event: 10
  • Pull request event: 3
  • Fork event: 1

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 912
  • Total Committers: 7
  • Avg Commits per committer: 130.286
  • Development Distribution Score (DDS): 0.14
Past Year
  • Commits: 50
  • Committers: 1
  • Avg Commits per committer: 50.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Arne Küderle a****e@g****m 784
Raul C. Sîmpetru r****u@f****e 46
livhe l****r@f****e 31
Annika Mücke a****e@o****e 31
Robert Richer r****r@f****e 17
Martin Ullrich m****h@f****e 2
Ann-Kristin Seifer a****r@f****e 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 68
  • Total pull requests: 55
  • Average time to close issues: 3 months
  • Average time to close pull requests: 10 days
  • Total issue authors: 9
  • Total pull request authors: 4
  • Average comments per issue: 0.79
  • Average comments per pull request: 0.69
  • Merged pull requests: 51
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 3
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: 6 days
  • Issue authors: 2
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • AKuederle (52)
  • paxtonfitzpatrick (3)
  • felixkluge (2)
  • livhe (1)
  • fleiscse (1)
  • a-mosquito (1)
  • potetopotatooo (1)
  • richrobe (1)
Pull Request Authors
  • AKuederle (55)
  • a-mosquito (4)
  • livhe (1)
  • richrobe (1)
Top Labels
Issue Labels
good first issue (2) help wanted (2) bug (2) documentation (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 1,982 last-month
  • Total dependent packages: 8
  • Total dependent repositories: 3
  • Total versions: 59
  • Total maintainers: 2
pypi.org: tpcp

Pipeline and Dataset helpers for complex algorithm evaluation.

  • Versions: 59
  • Dependent Packages: 8
  • Dependent Repositories: 3
  • Downloads: 1,982 Last month
Rankings
Dependent packages count: 1.4%
Dependent repos count: 8.9%
Average: 12.4%
Downloads: 13.1%
Stargazers count: 16.1%
Forks count: 22.6%
Maintainers (2)
Last synced: 4 months ago

Dependencies

poetry.lock pypi
  • 113 dependencies
pyproject.toml pypi
  • Sphinx ^5.1.1 develop
  • black ^22.3.0 develop
  • isort ^5.10.1 develop
  • matplotlib ^3.4.3 develop
  • memory-profiler ^0.58.0 develop
  • numpydoc ^1.4.0 develop
  • poethepoet ^0.10.0 develop
  • prospector ^1.7.7 develop
  • pydata-sphinx-theme ^0.9.0 develop
  • pyright ^1.1.230 develop
  • pytest ^6.2.1 develop
  • pytest-cov ^2.8.1 develop
  • recommonmark ^0.7.1 develop
  • sphinx-gallery ^0.11.0 develop
  • toml ^0.10.2 develop
  • joblib ^1.1.0
  • numpy ^1
  • optuna ^2.10.0
  • pandas ^1
  • python >=3.7.1,<3.11
  • scikit-learn ^1
  • torch >=1.6.0
  • tqdm ^4.62.3
  • typing-extensions >=4.1.1
.github/workflows/publish.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
.github/workflows/test-and-lint.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • codecov/codecov-action v2 composite