Skip to main content

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

Overview

The MED3pa package is specifically designed to address critical challenges in deploying machine learning models, particularly focusing 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 covariate shifts, uncertainty, and problematic data profiles.

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 Problematic 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

Overview

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 problematic 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

Statement

This package is part of https://www.medomics.ai/, a package providing research utility tools for developing precision medicine applications.

Copyright (C) 2024 MEDomics consortium

GPLV3 LICENSE SYNOPSIS

Here's what the license entails:

1. Anyone can copy, modify and distribute this software.
2. You have to include the license and copyright notice with each and every distribution.
3. You can use this software privately.
4. You can use this software for commercial purposes.
5. If you dare build your business solely from this code, you risk open-sourcing the whole code base.
6. If you modify it, you have to indicate changes made to the code.
7. Any modifications of this code base MUST be distributed with the same license, GPLv3.
8. This software is provided without warranty.
9. The software author or license can not be held liable for any damages inflicted by the software.

More information about the LICENSE can be found here

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

med3pa-1.0.0b4.tar.gz (276.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

med3pa-1.0.0b4-py3-none-any.whl (95.8 kB view details)

Uploaded Python 3

File details

Details for the file med3pa-1.0.0b4.tar.gz.

File metadata

  • Download URL: med3pa-1.0.0b4.tar.gz
  • Upload date:
  • Size: 276.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for med3pa-1.0.0b4.tar.gz
Algorithm Hash digest
SHA256 e2578d095fda4ad1b66066bdcc786f420e8b645a7ab95e3c3bfcb1ace32ceea6
MD5 78ad99ac0050218b3e137658dbd437d7
BLAKE2b-256 76c0393bcb24ed57aeae3bccf2373045dfd785f5d4aff76a890984539dfd3fcc

See more details on using hashes here.

Provenance

The following attestation bundles were made for med3pa-1.0.0b4.tar.gz:

Publisher: publish.yml on MEDomicsLab/MED3pa

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file med3pa-1.0.0b4-py3-none-any.whl.

File metadata

  • Download URL: med3pa-1.0.0b4-py3-none-any.whl
  • Upload date:
  • Size: 95.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for med3pa-1.0.0b4-py3-none-any.whl
Algorithm Hash digest
SHA256 8caca2401d11a24e90c168c93c377d0ac6fd9b1f39f3153d2678fcce48364b38
MD5 6c8e342e0fcc6574925de34ae663df69
BLAKE2b-256 1ac9d7ba91f9dc9e43145791581e807d74c1e0607cad4f9f169bc8b314f3ef82

See more details on using hashes here.

Provenance

The following attestation bundles were made for med3pa-1.0.0b4-py3-none-any.whl:

Publisher: publish.yml on MEDomicsLab/MED3pa

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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