Skip to main content

Medial EarlySign Python

Project description

Medial EarlySign Python Library

Pepy Total Downloads PyPI - License GitHub contributors GitHub commit activity

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

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.12)
Linux (Alpine/musl) 🛠️ Compile Required 🛠️ Compile Required
Windows ✅ Pre-built (Py 3.10-3.13) 🛠️ Compile Required
macOS 🛠️ Compile Required ✅ Pre-built (Py 3.10-3.13)

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.1.1.tar.gz (28.5 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.1.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (13.8 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

medpython-1.1.1-cp313-cp313-win_amd64.whl (10.4 MB view details)

Uploaded CPython 3.13Windows x86-64

medpython-1.1.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (13.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

medpython-1.1.1-cp313-cp313-macosx_14_0_arm64.whl (7.6 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

medpython-1.1.1-cp312-cp312-win_amd64.whl (10.3 MB view details)

Uploaded CPython 3.12Windows x86-64

medpython-1.1.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (13.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

medpython-1.1.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (13.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

medpython-1.1.1-cp312-cp312-macosx_14_0_arm64.whl (7.6 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

medpython-1.1.1-cp311-cp311-win_amd64.whl (10.4 MB view details)

Uploaded CPython 3.11Windows x86-64

medpython-1.1.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (13.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

medpython-1.1.1-cp311-cp311-macosx_14_0_arm64.whl (7.5 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

medpython-1.1.1-cp310-cp310-win_amd64.whl (10.4 MB view details)

Uploaded CPython 3.10Windows x86-64

medpython-1.1.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (13.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

medpython-1.1.1-cp310-cp310-macosx_14_0_arm64.whl (7.5 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for medpython-1.1.1.tar.gz
Algorithm Hash digest
SHA256 d8b158344e05d80f6513d360a015c91c0a0b6964403fc5bf1fb9997ee80598c3
MD5 91bf78d55fb371c26b1a4b74d0ec3290
BLAKE2b-256 928fc3ada429a82eb72b86a5b222d69d75e65ed6bcb0fe3a10fb68c131aeebd5

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.1.1.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.1.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for medpython-1.1.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 317d5dfc894a98a80ee1440f5b108b30f8743c95f4836e89c0c4e20b88326aa3
MD5 e3ae0dd56929421f3e8566ee859c2d6b
BLAKE2b-256 ca7615814eb564b5701b67232a0b78b53904207adbd92297fa6a9ace4874dbc2

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.1.1-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.1.1-cp313-cp313-win_amd64.whl.

File metadata

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

File hashes

Hashes for medpython-1.1.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f0a4a4ac45b72296955f540a0cdec92bcd3c915b3c56c1b88dfa834ba3b2403f
MD5 a7d4881309ee41ef87a6ba998aedcd58
BLAKE2b-256 71c551f4da0cc8231e5e2f7236b61299e1007275e99d621daed40090c7bf3604

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.1.1-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.1.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for medpython-1.1.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 ab99425490e8342954e3a905a680128c6c0510ef755836ef1fe0afa474ac6409
MD5 c7b38654b954f78f3a65f873123ddc51
BLAKE2b-256 95d4a1eb8a089ebb94024c7a771b189138a2642a50157c17e83783bb62b43013

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.1.1-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.1.1-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for medpython-1.1.1-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 dcc31820d33a083b1a349182fe88c0533fb9b1ff2e4f7befa884dd3d4da062e3
MD5 bc4364dbb2a844201689f1de17a9a09d
BLAKE2b-256 03514bc54c9bfd8794a72323d4e467cdd610816345c9d52f38bd5610872cec9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.1.1-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.1.1-cp312-cp312-win_amd64.whl.

File metadata

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

File hashes

Hashes for medpython-1.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 60ae8227db424c15e7ba1b08f2b78d7eec939846eda581e57f35e7f79ea73007
MD5 3fe0234edea2a16a40d25752b07465db
BLAKE2b-256 1be4801c04b06903b4f2563270aad8b050f663ff26cd7f14b7ef835c9383b56c

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.1.1-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.1.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for medpython-1.1.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 97c130fe8875035bc656cd0ddef9426c1f4cbba4c0916ff1ae3b21b87413ab79
MD5 2f71146e4730c55d49f3822010216d14
BLAKE2b-256 2ab4b1355e3061e7bb22f88ecc8c73110993b1c4b2f4826e99fcdea080ba73f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.1.1-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.1.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for medpython-1.1.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 ca92b2c78e3a7c9eeca73db71a50bedbf7ceb5f575584dd8ffae5ccec234690f
MD5 dd74be1d7cd87979386545731f84c7eb
BLAKE2b-256 6cc6f61a9bcfc069309e914d8776387eb2f4652489bd249d06b233ea6fc5a2b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.1.1-cp312-cp312-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.1.1-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for medpython-1.1.1-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 114c3186567d7f4504195b75d4100b560f86a79ceb23d4869df40991c5f7b037
MD5 8ed7a1edbd944e89e9c15ebcfb1daaf3
BLAKE2b-256 8564cb052fd30935d5a549b150ab26373d25a5748ad0dc889090b18eeac867b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.1.1-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.1.1-cp311-cp311-win_amd64.whl.

File metadata

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

File hashes

Hashes for medpython-1.1.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 902d2620da7b09375685ae57a23ab358ad9f279d4fb8ce5e26f35036308aabdc
MD5 c70086803fbd29739ca3f2e79b4a6a6f
BLAKE2b-256 0bb1331b7def70d20ce8db55627bc058d590f3315c0f41bedb6aff9635e390c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.1.1-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.1.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for medpython-1.1.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 f517a2fabd3608f6dcc6e3db8908a77c1950743beca3f070fd10e3ad1893c2b2
MD5 f450b9dfe8dd3264b5430cf39b000c76
BLAKE2b-256 021c94354ec2ad3f05202734f51ad529a963843d282a2d87653144bbeac115b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.1.1-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.1.1-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for medpython-1.1.1-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 6aa9b8c77968dd5aa8e4e783aeb89fb69b279701413c61ac242f22d995e621e7
MD5 6659d8c477ecbac118e092354e645c8a
BLAKE2b-256 323767d99c772bb9b3b96e8ee3052fa3b5ab20f8a547fd87bfa055e37552fcc8

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.1.1-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.1.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: medpython-1.1.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 10.4 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for medpython-1.1.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 684692edb2e122c0ae32db2c2a9100f1ea4a2652fcd8daff70d4b7c3ae6904e7
MD5 039ae5b0ffe4097ba3c8cfffc76f92e1
BLAKE2b-256 76e3c0dcb9f5c244e7d0a169262d25e951ca55132d8bb5602de3c1e08aa5be8e

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.1.1-cp310-cp310-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.1.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for medpython-1.1.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 94d8670a9b783c3f9edc67a327ff5aa4f7498a74630ca824b247faac1f11bef2
MD5 38ae03f4613bdf361b7eb128efc9a0f2
BLAKE2b-256 3a9609a860f2612f34e69e3c1ad67b2982ad6355a5180fbb4a0f2c49e4aabe3b

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.1.1-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.

File details

Details for the file medpython-1.1.1-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for medpython-1.1.1-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 2ac6d2c4a2d7fb73d4099b0d9676447740b0bc925779e1da972e399eb7516870
MD5 e927fe6ab373a6443b1341290c4baa2f
BLAKE2b-256 d06b9d641351ae1702515a63936716ce18520fc1e39819a65578885a19dfdadc

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.1.1-cp310-cp310-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.

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