Metadata-Version: 2.4
Name: medpipe
Version: 0.4.1
Summary: Configuration-driven, TRIPOD+AI compliant ML pipelines for tabular clinical data.
Author-email: Mathias Roesler <mathias.roesler@auckland.co.nz>
License-Expression: Apache-2.0
Project-URL: Changelog, https://github.com/Surgical-Recovery-and-Safety-Lab/medpipe/blob/main/CHANGELOG.md
Project-URL: Homepage, https://github.com/Surgical-Recovery-and-Safety-Lab/medpipe
Project-URL: Repository, https://github.com/Surgical-Recovery-and-Safety-Lab/medpipe.git
Classifier: Intended Audience :: Healthcare Industry
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: matplotlib>=3.10.0
Requires-Dist: ngboost>=0.5.10
Requires-Dist: numpy>=2.0.0
Requires-Dist: ordboost>=0.6.0
Requires-Dist: pandas>=2.2.0
Requires-Dist: pyarrow>=15.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: pysplinecalib>=0.0.1
Requires-Dist: scikit-learn>=1.8.0
Requires-Dist: scipy>=1.12.0
Requires-Dist: scores>=2.6.0
Provides-Extra: excel
Requires-Dist: openpyxl>=3.1.0; extra == "excel"
Provides-Extra: dev
Requires-Dist: openpyxl>=3.1.0; extra == "dev"
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-mock>=3.12.0; extra == "dev"
Requires-Dist: trove-classifiers>=2024.1.1; extra == "dev"
Requires-Dist: medpipe[docs]; extra == "dev"
Provides-Extra: docs
Requires-Dist: mkdocs<2,>=1.5.0; extra == "docs"
Requires-Dist: mkdocs-material>=9.5.0; extra == "docs"
Requires-Dist: mkdocstrings[python]>=0.24.0; extra == "docs"
Requires-Dist: mkdocs-include-markdown-plugin; extra == "docs"
Requires-Dist: ruff>=0.16.7; extra == "docs"
Requires-Dist: mypy>=2.3.0; extra == "docs"
Requires-Dist: pandas-stubs; extra == "docs"
Dynamic: license-file

# MedPipe

[![PyPI Version](https://img.shields.io/pypi/v/medpipe.svg)](https://pypi.org/project/medpipe/)
[![PyPI Python Versions](https://img.shields.io/pypi/pyversions/medpipe.svg)](https://pypi.org/project/medpipe/)
[![License](https://img.shields.io/github/license/Surgical-Recovery-and-Safety-Lab/medpipe)](https://github.com/Surgical-Recovery-and-Safety-Lab/medpipe/blob/main/LICENSE)
[![tests](https://github.com/Surgical-Recovery-and-Safety-Lab/medpipe/actions/workflows/run_test.yml/badge.svg)](https://github.com/Surgical-Recovery-and-Safety-Lab/medpipe/actions/workflows/run_test.yml)
[![Docs](https://img.shields.io/badge/docs-mkdocs-526CFE?style=flat&logo=materialforgithub)](https://Surgical-Recovery-and-Safety-Lab.github.io/medpipe/)

## Table of content
1. [Overview](#overview)
2. [Installation](#installation)
3. [Key features](#key-features)
4. [Quickstart example](#quickstart-example)
5. [Acknowledgements](#acknowledgements)

## Overview
The **MedPipe** package is a layer to help create AI models (classifiers and regressors) for clinical applications from tabular data. It covers data loading and preprocessing, model creation and training, recalibration, and visualisation. 
___

## Installation

To install **MedPipe** use pip:
```
$ pip install medpipe
```
___

## Key features

* **TRIPOD+AI Guideline Compliant**: Designed from the ground up to follow rigorous clinical machine learning reporting standards.
* **Scikit-Learn Compatible**: Integrates seamlessly with standard Scikit-Learn estimators, transformers, and pipelines.
* **Declarative TOML Configuration**: Define entire experiments, from preprocessing to plotting aesthetics, in a single validated TOML configuration file.
* **Multi-Outcome Pipelines**: Model distinct clinical outcomes in a single run with independent hyperparameter and recalibration overrides.
* **Integrated Recalibration & Fairness**: Native probability recalibration and stratified subgroup analysis to evaluate algorithmic fairness across patient cohorts.
* **Clinical Metrics & Visualizations**: Automatic generation of Decision Curve Analysis (DCA), reliability diagrams, ROC/PR curves, and bootstrapped 95% confidence intervals.
* **Standardized Artifact Tracking**: Automatic, structured output management for models, metrics, environment metadata, and execution logs in a unified `artifacts/` hierarchy.
___

## Quickstart example

Minimal example based on the provided configuration file (`examples/default_classifier_config.toml`):

``` py linenums="1", title="Minimal example"
from pydantic import ValidationError

from medpipe import MedpipeClassifier

try:  # Catch any Pydantic configuration errors
    pipe = MedpipeClassifier("default_classifier_config.toml")
    pipe.run()
except ValidationError as err:
    print(err)
    exit()
```
___

## Acknowledgements

This package was developed using Claude Sonnet 5.5. The code was reviewed and edited by humans.
