Python Open-source package for ensuring robust and reliable ML models deployments
Project description
MED3pa: Predictive Performance Precision Analysis in Medicine
Table of Contents
- Overview
- Key Functionalities
- Subpackages
- Getting Started with the Package
- Acknowledgement
- References
- Authors
- Statement
- Supported Python Versions
Overview
The MED3pa package is specifically designed to address critical challenges in deploying machine learning models, with a particular focus on the robustness and reliability of models under real-world conditions. It provides comprehensive tools for evaluating model stability and performance in the face of prediction uncertainty and disadvantaged data profiles associated with degraded model performance. This work is developed alongside the associated methodological article, published in the Journal of the American Medical Informatics Association (JAMIA): https://doi.org/10.1093/jamia/ocag034. The full code used to generate the results presented in the article is available here: https://github.com/MEDomicsLab/study_3pa.
Key Functionalities
-
Model Confidence Estimation: Through the MED3pa subpackage, the package measures the predictive confidence at both individual and group (profile) levels. This helps in understanding the reliability of model predictions and in making informed decisions based on model outputs.
-
Identification of disadvantaged Profiles: MED3pa analyzes data profiles for whom the BaseModel consistently leads to poor model performance. This capability allows developers to refine training datasets or retrain models to handle these edge cases effectively.
Subpackages
The package is structured into four distinct subpackages:
- datasets: Stores and manages the dataset.
- models: Handles ML models operations.
- med3pa: Evaluates the model’s performance & extracts disadvantaged profiles.
This modularity allows users to easily integrate and utilize specific functionalities tailored to their needs without dealing with unnecessary complexities.
Getting Started with the Package
To get started with MED3pa, follow the installation instructions and usage examples provided in the documentation.
Installation
pip install MED3pa
A simple exemple
We have created a simple example of using the MED3pa package. See the full example here
from MED3pa.datasets import DatasetsManager
from MED3pa.med3pa import Med3paExperiment
from MED3pa.models import BaseModelManager
from MED3pa.visualization.mdr_visualization import visualize_mdr
from MED3pa.visualization.profiles_visualization import visualize_tree
...
# Initialize the DatasetsManager
datasets = DatasetsManager()
datasets.set_from_data(dataset_type="testing",
observations=x_evaluation.to_numpy(),
true_labels=y_evaluation,
column_labels=x_evaluation.columns)
# Initialize the BaseModelManager
base_model_manager = BaseModelManager(model=clf)
# Execute the MED3PA experiment
results = Med3paExperiment.run(
datasets_manager=datasets,
base_model_manager=base_model_manager,
**med3pa_params
)
# Save the results to a specified directory
results.save(file_path='results/oym')
# Visualize results
visualize_mdr(result=results, filename='results/oym/mdr')
visualize_tree(result=results, filename='results/oym/profiles')
Acknowledgement
MED3pa is an open-source package developed at the MEDomicsLab laboratory. We welcome any contribution and feedback.
Authors
- Olivier Lefebvre: Student (Ph. D. Computer science) at Université de Sherbrooke
- Lyna Chikouche: Research intern at MEDomicsLab laboratory.
- Ludmila Amriou: Research intern at MEDomicsLab laboratory.
- Martin Vallières: Associate professor, Department of Oncology at McGill University
Supported Python Versions
The MED3pa package is developed and tested with Python 3.12.3.
Additionally, it is compatible with the following Python versions:
- Python 3.11.x
- Python 3.10.x
- Python 3.9.x
While the package may work with other versions of Python, these are the versions we officially support and recommend.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file med3pa-1.0.3.tar.gz.
File metadata
- Download URL: med3pa-1.0.3.tar.gz
- Upload date:
- Size: 314.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa3d67ef6de03ed10eafe2b681227463793255d64b7fb924c469a99f84522cdf
|
|
| MD5 |
5e188aa29f81e2fddc6cadabd472c7e7
|
|
| BLAKE2b-256 |
87f0c84d1c4ccecf059fae6fdc6b2ea592fbea8490563c636a4ac1c3b56c9f5e
|
Provenance
The following attestation bundles were made for med3pa-1.0.3.tar.gz:
Publisher:
publish.yml on MEDomicsLab/MED3pa
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
med3pa-1.0.3.tar.gz -
Subject digest:
aa3d67ef6de03ed10eafe2b681227463793255d64b7fb924c469a99f84522cdf - Sigstore transparency entry: 1411981139
- Sigstore integration time:
-
Permalink:
MEDomicsLab/MED3pa@b3d3a90a620b593340a841ac6052cf71e8c40a54 -
Branch / Tag:
refs/tags/v1.0.3 - Owner: https://github.com/MEDomicsLab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b3d3a90a620b593340a841ac6052cf71e8c40a54 -
Trigger Event:
release
-
Statement type:
File details
Details for the file med3pa-1.0.3-py3-none-any.whl.
File metadata
- Download URL: med3pa-1.0.3-py3-none-any.whl
- Upload date:
- Size: 95.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4f3c5c1f2105d3dc0baa1d0772e75a4c6b2094326c1cfb4c60337302e788553
|
|
| MD5 |
47d305acf215871f5a1a9f50c25e8f51
|
|
| BLAKE2b-256 |
5a6783774133cbfa225ecbf2e060e1e7273ddfa32a7c058e256c9aec3929b5d5
|
Provenance
The following attestation bundles were made for med3pa-1.0.3-py3-none-any.whl:
Publisher:
publish.yml on MEDomicsLab/MED3pa
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
med3pa-1.0.3-py3-none-any.whl -
Subject digest:
a4f3c5c1f2105d3dc0baa1d0772e75a4c6b2094326c1cfb4c60337302e788553 - Sigstore transparency entry: 1411981220
- Sigstore integration time:
-
Permalink:
MEDomicsLab/MED3pa@b3d3a90a620b593340a841ac6052cf71e8c40a54 -
Branch / Tag:
refs/tags/v1.0.3 - Owner: https://github.com/MEDomicsLab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b3d3a90a620b593340a841ac6052cf71e8c40a54 -
Trigger Event:
release
-
Statement type: