Skip to main content

Pipeline and Dataset helpers for complex algorithm evaluation.

Project description

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

tpcp - Tiny Pipelines for Complex Problems

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

pip install tpcp

Why?

Evaluating Algorithms - in particular when they contain machine learning - is hard. Besides understanding required steps (Cross-validation, Bias, Overfitting, ...), you need to implement the required concepts and make them work together with your algorithms and data. If you are doing something "regular" like training an SVM on tabulary 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 organise 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 continues 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 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 we had 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 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 gridsearch 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 gridsearch 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.

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

tpcp-0.2.0a1.tar.gz (32.5 kB view details)

Uploaded Source

Built Distribution

tpcp-0.2.0a1-py3-none-any.whl (36.1 kB view details)

Uploaded Python 3

File details

Details for the file tpcp-0.2.0a1.tar.gz.

File metadata

  • Download URL: tpcp-0.2.0a1.tar.gz
  • Upload date:
  • Size: 32.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.10.0 Linux/5.11.0-1021-azure

File hashes

Hashes for tpcp-0.2.0a1.tar.gz
Algorithm Hash digest
SHA256 768ba038fe88f0379770aa5d485e5dd0b9f05f9ffc4cd4052e6591c021d77d09
MD5 cf6cde2691b4f1dfa2a4c39c9d6fd982
BLAKE2b-256 34bdfeaa995849dd5e517ea7857ff1741eb5c42da205bef81a9a99a02f079747

See more details on using hashes here.

File details

Details for the file tpcp-0.2.0a1-py3-none-any.whl.

File metadata

  • Download URL: tpcp-0.2.0a1-py3-none-any.whl
  • Upload date:
  • Size: 36.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.10.0 Linux/5.11.0-1021-azure

File hashes

Hashes for tpcp-0.2.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 397ec1b10ad7fd259ae79e70fe58a8d747f5b2df08a67657cbb152be482c358a
MD5 583afe53390aad14179f0c0640d058a8
BLAKE2b-256 09963c4d951c9fe16eb2be5476a661fa3171ea54e0193c507cbdb6ec52b4e2f4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page