Skip to main content

Medial EarlySign Python

Project description

Medial EarlySign Python Library

Pepy Total Downloads PyPI - License GitHub contributors GitHub commit activity

Conda Version Conda Downloads

GitHub Repo GitHub Repo stars

A note on our journey: Medial EarlySign was a company that developed a proprietary platform for machine learning on electronic medical records. Following the company's liquidation, the decision was made to release the core software as an open-source project to allow the community to benefit from and build upon this technology. Please feel free to reach me out in any case of an issue. I'm voluntarily holding this, so please be patients.

Our platform is designed to transform complex, semi-structured Electronic Medical Records (EMR) into machine-learning-ready data and reproducible model pipelines. The framework is optimized for the unique challenges of sparse, time-series EMR data, delivering low memory usage and high-speed processing at scale.

It was conceived as a TensorFlow for machine learning on medical data.

All software is now open-sourced under the MIT license. Some of the models developed by Medial EarlySign that are currently in production are available exclusively through our partners.

The framework was battle-tested in production across multiple healthcare sites and was a key component of an award-winning submission to the CMS AI Health Outcomes Challenge.

Why Use This Platform?

  • High-Performance Processing: Engineered for large-scale, sparse EMR time-series data where general-purpose libraries like pandas fall short.
  • Reusable Pipelines: Save valuable engineering time by providing shareable, tested pipelines and methods.
  • Built-in Safeguards: Mitigate common pitfalls like data leakage and time-series-specific overfitting.
  • Production-Ready: Designed for easy deployment using Docker or minimal distroless Linux images. FHIR Ready with lightweight python script convert to AlgoMarker format in deployment.
  • Innovative Algorithms: Access to state of the art algorithms for processing medical data, explainability, fairness, and more

Core Components

The platform is built on three key pillars:

  • MedRepository: A compact, efficient data repository and API for storing and accessing EMR signals. Querying categorical signals like perscriptions and diagnosis in an easy and efficient API.
  • MedModel: An end-to-end machine learning pipeline that takes data from MedRepository or JSON EMR inputs to produce predictions and explainability outputs. It supports both training and inference.
  • Medial Tools: A suite of utilities for training, evaluation, and workflow management, including bootstrap analysis, fairness checks, and explainability. MedPython is the Python alternative to replace all those tools.

From Raw Data to Insight in Four Simple Steps

Our platform streamlines the development and deployment of clinical predictive models, transforming raw patient data into actionable insights. For live predictions (inference), you can use raw JSON data directly, bypassing the need for an optimized data store.

This structured approach ensures that data is processed efficiently, models are built systematically, and the results are both accurate and interpretable.

The Workflow

1. Start with Raw Patient Data

Begin with your data in a simple JSON format.

{
  "patient_id": "1",
  "data": {
    "signals": [
      {
        "code": "Hemoglobin",
        "unit": "g/dL",
        "data": [
          { "timestamp": [20240806], "value": ["14.1"] },
          { "timestamp": [20250806], "value": ["14.5"] }
        ]
      },
      {
        "code": "Diagnosis",
        "data": [
          { "timestamp": [20240701], "value": ["ICD10_CODE:J20"] },
          ...
        ]
      },
      ...
    ]
  }
}

Load it into our Optimized Store or use it "as is" in deployment.

2. Define Your Label

For each patient, and for any chosen prediction date (after which no future information is provided to the model), specify what the outcome label should be for training or testing

3. Define Your ML Pipeline

Configure your entire machine learning workflow from preprocessing and feature engineering to the final model using a single JSON configuration file. This approach ensures your experiments are reproducible and easy to version.

4. Get Explainable Predictions

Train your model using the Python SDK and generate predictions with clear, interpretable explanations. Example output.

This is an illustration of the final output in a visual format (Our infrastructure returns the data to create this):

For more details, refer to the Tutorials.

Setup

You can quickly install the package using pip:

pip install medpython

or Through conda

conda install -c conda-forge medpython

Install and compile from github source code:

python -m pip install -v "medpython @ git+https://github.com/Medial-EarlySign/medpython.git/#subdirectory=Internal/MedPyExport/generate_binding"

System Requirements

Platform Support for MedPython

Platform x86_64 (Intel/AMD) aarch64 (ARM / Apple Silicon)
Linux (glibc) ✅ Pre-built (Py 3.10-3.14) ✅ Pre-built (Py 3.13)
Linux (Alpine/musl) 🛠️ Compile Required 🛠️ Compile Required
Windows ✅ Pre-built (Py 3.11-3.14) 🛠️ Compile Required
macOS 🛠️ Compile Required ✅ Pre-built (Py 3.11-3.14)

Note: For any Compile Required or either not listed as Pre-built. Compliation is required. Compilation in Alpine was also tested, but pre-builds are not provided.

  • Supported Systems: This linux pre-built version is available for modern Linux distributions (specifically manylinux2014 equivalents, such as CentOS >= 7 or Ubuntu >= 13.04).

Compilation for Other Systems More information in Installation

Release Notes

Please refer to Release Notes

Usage

import med
from AlgoMarker import AlgoMarker
from ETL_Infra import prepare_final_signals, prepare_dicts, finish_prepare_load, create_train_signal

More information on usage:

Getting Started

  • Build a new model: Follow the step-by-step Tutorials to build a model from scratch.
  • Use an existing model: Browse the collection of Models.

Community and Contributions

This is an open-source project, and we welcome contributions from the community.

  • Report issues or ask questions: Please use our Github Discussions.
  • Contribute to the code: Check out our repositories:

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

medpython-1.2.0.tar.gz (2.4 MB view details)

Uploaded Source

Built Distributions

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

medpython-1.2.0-cp314-cp314-win_amd64.whl (12.1 MB view details)

Uploaded CPython 3.14Windows x86-64

medpython-1.2.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (15.2 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

medpython-1.2.0-cp314-cp314-macosx_14_0_arm64.whl (8.5 MB view details)

Uploaded CPython 3.14macOS 14.0+ ARM64

medpython-1.2.0-cp313-cp313-win_amd64.whl (11.8 MB view details)

Uploaded CPython 3.13Windows x86-64

medpython-1.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (15.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

medpython-1.2.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (14.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

medpython-1.2.0-cp313-cp313-macosx_14_0_arm64.whl (8.5 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

medpython-1.2.0-cp312-cp312-win_amd64.whl (11.8 MB view details)

Uploaded CPython 3.12Windows x86-64

medpython-1.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (15.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

medpython-1.2.0-cp312-cp312-macosx_14_0_arm64.whl (8.5 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

medpython-1.2.0-cp311-cp311-win_amd64.whl (11.8 MB view details)

Uploaded CPython 3.11Windows x86-64

medpython-1.2.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (15.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

medpython-1.2.0-cp311-cp311-macosx_14_0_arm64.whl (8.5 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

medpython-1.2.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (15.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

File details

Details for the file medpython-1.2.0.tar.gz.

File metadata

  • Download URL: medpython-1.2.0.tar.gz
  • Upload date:
  • Size: 2.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for medpython-1.2.0.tar.gz
Algorithm Hash digest
SHA256 eeee5a38889fe3a30241ac115fc20614c03a227a1653e775c54a0af503f6b8f4
MD5 5bb7f0412ff0f9cef42a4c9e72d4a7ca
BLAKE2b-256 37fb179653ccf7c71102b023323c86f1dd7e155d409d787144e57ce5f155aee2

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.2.0.tar.gz:

Publisher: build_py.yaml on Medial-EarlySign/MR_Scripts

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

File details

Details for the file medpython-1.2.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: medpython-1.2.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 12.1 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for medpython-1.2.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 a4768a1b793da2b761f9825812990675014c749fdadd576ab179a17ff270bc1f
MD5 91a770c40ba45535abb994687a0caacd
BLAKE2b-256 edccf27cc00cab7e3a91815be43f741a31c9c858aade76a0997c3d0331b32e1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.2.0-cp314-cp314-win_amd64.whl:

Publisher: build_py_windows.yaml on Medial-EarlySign/MR_Scripts

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

File details

Details for the file medpython-1.2.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for medpython-1.2.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 4e03b6f536fb48d3e6e39a2012656670dafe12cea9a276e24255009a73c3026e
MD5 71ba9c1636f7c440d4027e8762cfba24
BLAKE2b-256 604c2f6390b2fc6528cd170a777d51520e71ae06309938473527331382cb99c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.2.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:

Publisher: build_py.yaml on Medial-EarlySign/MR_Scripts

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

File details

Details for the file medpython-1.2.0-cp314-cp314-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for medpython-1.2.0-cp314-cp314-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 b5a4bb6ef3441da717bd0d5e28cd724fc655d94243adeb66a159ada2cdf60746
MD5 f72c984d0a169f6e08f6e2e678d684c3
BLAKE2b-256 d65e6e3968a23cbcbef2fe1e3fc6b347920b3f4be3076ebee767ed8667efc98e

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.2.0-cp314-cp314-macosx_14_0_arm64.whl:

Publisher: build_py_mac.yaml on Medial-EarlySign/MR_Scripts

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

File details

Details for the file medpython-1.2.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: medpython-1.2.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 11.8 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for medpython-1.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 68c6cd5e46b90d73eecfb4c3e0e0ffe41ae233e1a5dda106e30b466ae8fd7e46
MD5 23cbf45b53d777029fb0123749d30128
BLAKE2b-256 90b45e6aa35c6efa29367f644131cf36eb1ef7184e12e35a08f267624256c0c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.2.0-cp313-cp313-win_amd64.whl:

Publisher: build_py_windows.yaml on Medial-EarlySign/MR_Scripts

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

File details

Details for the file medpython-1.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for medpython-1.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 98c4c55dd44ede80180dc9d2c30e605943028518084db5b35ab95fbe1bcff6ae
MD5 570075ea7597a7e8dd4326f0e2e35dae
BLAKE2b-256 547d86809866e48fb8a2c7720bf2b52c1a39449a09c2bb0638418b1a23bb0dd0

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:

Publisher: build_py.yaml on Medial-EarlySign/MR_Scripts

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

File details

Details for the file medpython-1.2.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for medpython-1.2.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 548543f41148336d91f326aa411b6a096c6a27e722e5793d473de98de1527b42
MD5 66c44f118d588cf92faa41d18e21b97f
BLAKE2b-256 6b16ca1cb53bfa4ad27f5691bfd8e9c097a818e78393025d90818e13833f67f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.2.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl:

Publisher: build_py_arm.yaml on Medial-EarlySign/MR_Scripts

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

File details

Details for the file medpython-1.2.0-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for medpython-1.2.0-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 2c36acf666e037792e86262b9de1ba8d84ec65fc3897166b4e8a32ed65c84e60
MD5 396a95ad84e0cebef301490c3c64fb69
BLAKE2b-256 772b41fc961079b92c7d9aea9ed8055fc4182bd9750e3152439cd1710a9a42a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.2.0-cp313-cp313-macosx_14_0_arm64.whl:

Publisher: build_py_mac.yaml on Medial-EarlySign/MR_Scripts

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

File details

Details for the file medpython-1.2.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: medpython-1.2.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 11.8 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for medpython-1.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e641a3c6055d8399670019af42321bf9088b75dfd3503bfac0258eeee4d0de5c
MD5 6628bcf8ba409524e003b5e55492d61d
BLAKE2b-256 cbb0af2045d34ea10b766004ece2ac1a197e50f69e424010017b03c857d0e57b

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.2.0-cp312-cp312-win_amd64.whl:

Publisher: build_py_windows.yaml on Medial-EarlySign/MR_Scripts

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

File details

Details for the file medpython-1.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for medpython-1.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 7731a8967abd10bb7f0ca24d66252cd86aa275e49fb3a5a712be04ce3aab9e37
MD5 9dd1a93f3d4153a8039b71753aa510f4
BLAKE2b-256 19b13bd998f8de4c43078339da5e69c694839eb06d094a6278af197d75faa9a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:

Publisher: build_py.yaml on Medial-EarlySign/MR_Scripts

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

File details

Details for the file medpython-1.2.0-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for medpython-1.2.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 89d850fc84b0e1957386cb0f3491dff127f9069fa9720a0b7a5c943404cc25cb
MD5 1000e6455872f6e85f8a99649e6cb0da
BLAKE2b-256 706d4f1549386c33ed4b66ae4f8ee4543e1bc8babc487d1f264334a139d649fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.2.0-cp312-cp312-macosx_14_0_arm64.whl:

Publisher: build_py_mac.yaml on Medial-EarlySign/MR_Scripts

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

File details

Details for the file medpython-1.2.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: medpython-1.2.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 11.8 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for medpython-1.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b58a2118ebe1f2d6b58270e3ef916c6c94323e72d779493014a7ec2910f8dab4
MD5 1b822b0f5d75ebebd35d489e76c2cf4c
BLAKE2b-256 ec2720a073473406f1a5ea963588bb666b711f04c57f4943550f69d30f6b6dcf

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.2.0-cp311-cp311-win_amd64.whl:

Publisher: build_py_windows.yaml on Medial-EarlySign/MR_Scripts

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

File details

Details for the file medpython-1.2.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for medpython-1.2.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 19b09fbdd3efd199e36f4e69610ba24d7d15bdb479b75bfc42e1715f47bcad5f
MD5 18f05aba09e0fe6af214dfa3a19f553f
BLAKE2b-256 5d072adf1812d0d7512cb0e068d92236e1cbc0209d7255582e8633f40945dbc8

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.2.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:

Publisher: build_py.yaml on Medial-EarlySign/MR_Scripts

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

File details

Details for the file medpython-1.2.0-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for medpython-1.2.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 511b1fae24c65cee7d3d1cb9ba3a99f71790dd8e8fb4983d93a053ee7e80deed
MD5 2581edb8e7d2d1e41e0e1ed6df654c4b
BLAKE2b-256 ef4b5a872e5eb76d986f070bb21082d483ce5f2855c08d4265e5882f5c835a3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.2.0-cp311-cp311-macosx_14_0_arm64.whl:

Publisher: build_py_mac.yaml on Medial-EarlySign/MR_Scripts

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

File details

Details for the file medpython-1.2.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for medpython-1.2.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 07b599e63e1729b98f96f98a528b11d187c487b51ed9f9827a87f2fb4dc937f1
MD5 e03698da0f747a3333fa887550314ad7
BLAKE2b-256 4d127390b2b98295c9b0974ec18a0b8b81d7b5c78da2a837953d97fe0e55bca3

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.2.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:

Publisher: build_py.yaml on Medial-EarlySign/MR_Scripts

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