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.2.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.2-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.2-cp313-cp313-win_amd64.whl (10.4 MB view details)

Uploaded CPython 3.13Windows x86-64

medpython-1.1.2-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.2-cp313-cp313-macosx_14_0_arm64.whl (7.6 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

medpython-1.1.2-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.2-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.2-cp312-cp312-macosx_14_0_arm64.whl (7.6 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

medpython-1.1.2-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.2-cp311-cp311-macosx_14_0_arm64.whl (7.6 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

medpython-1.1.2-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.2-cp310-cp310-macosx_14_0_arm64.whl (7.6 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for medpython-1.1.2.tar.gz
Algorithm Hash digest
SHA256 d0a985526c482a9667f65a66e7b135e579c421feac9b2f53ff1769e1a95f8e70
MD5 8fac049fc7a4e98e83dc34d3f1fc5731
BLAKE2b-256 adfb5ab3d747dad737a0f714adce1d0df755a52689e520067a88d7dd4ca74e80

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.1.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 3514fe716f186512183ada5d328b66f076b32c7f4e29815c9347a467d6e5ff27
MD5 800219f551dba8fb353d2ea3ff5ef2f4
BLAKE2b-256 5026e1bd0673afc57e33cdf75d12a26fa5f950f788cbf98994fcc8f6c42624bb

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: medpython-1.1.2-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.12

File hashes

Hashes for medpython-1.1.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4b5f995086d2b1215126da12169b8033faf76bb314d71c1b64483b3a408a3520
MD5 6a69459295bd693d0f71ddd112131dc8
BLAKE2b-256 6b77fd8cadb4456874d7b9acd9f3235b2357691fc335e57edd491a0bf242d83d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.1.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 4527f5a979fc1296fd2d3fb631a72e622601b1efd11809fe22fdd9345bd52e14
MD5 b2e4201299e5cd3e68def11ed5ff2f0f
BLAKE2b-256 714aa2a70cf54d8dffcd03e3b0d949dd270dc2e223605dd3a4870adeb1168758

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.1.2-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 aea640e43e5d5163bf6162b1c1b85b5fdd0c5ad94d7f3e755c87b16df60e1a56
MD5 c27f7a46462df2dbb8c67e149f3b8b1d
BLAKE2b-256 251b66409f20a3a670bb1aa920b0ed889077288f6da8f65de9f3c501339bef83

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: medpython-1.1.2-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.12

File hashes

Hashes for medpython-1.1.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 30ab9759d5dd28fb3be8b415a91a7b260a87f87ff2fbcbec2630e6853cb50386
MD5 2fe457d8b2ae73095fd2bf2f829fda66
BLAKE2b-256 ecc93699757bec58a53233bb6406f5be31b251e84a8c9a02d76a8bd312251744

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.1.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 a8131dfe66416bca7660ae4cfba2b8d5936c970cf20c9a28ba49d9c74a0e855e
MD5 c65a6d7a175a21e517167370830a568a
BLAKE2b-256 e17e687c3d1994ec7290034b6d3ee62f84febb2095c95e3ceb626005eee4b338

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.1.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 59bcda466e2b83a5f3b49145be8df0880e387b4ae028a51fa272fca045f8f305
MD5 d2d55c1a813cbec8c7dc4b325a2aedea
BLAKE2b-256 4da3fad0551cf74e67b8ab4a28420f304fe0d0f01015d63f8b0acc6bfe3c5805

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.1.2-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 ce066ec46f487a5ed40a4dec901d0a6d1bb182de634649017cee6c9ca2380592
MD5 2c5e235e7c43fd77cccee986f8f087b5
BLAKE2b-256 f9bdd65f0636e1a11738a593c48ce782eae17440b02ee1883d51eec53fe2a5c5

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: medpython-1.1.2-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.12

File hashes

Hashes for medpython-1.1.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d7ec44c8572d02dd0064c560db95b5c4428f9b00eeaab92d88f152ddcff93e5c
MD5 fb921d2902090ba66901614f7822c4d4
BLAKE2b-256 4bbddcb7c260f8ed8800e6eeb5aea177e2893ff691ea1a851eaf3d77e2c2a2a7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.1.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 4a7d01c2cb14488c7eb50d183efe75cb2414f4afa0b9924ab51dcda2efb45c4d
MD5 d21a217f9c23075e7b74148fabedc222
BLAKE2b-256 04823b8646c319b1f5d1b4f10c6e1f7fd674f9ff9c9a4d028137ff9beb078063

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.1.2-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 de0873a665f7bb05d0a777273ebc9149aa842d8c86d2e91565cfc15c7b35a52c
MD5 acdf71dedaf9e6d2740ba2a42799c4a2
BLAKE2b-256 7d24ad258066eee9f0a44e012664c8e6baa545126347e10f8ae6ab6502676aa0

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: medpython-1.1.2-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.12

File hashes

Hashes for medpython-1.1.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 007195b14007d53d752cbe3e60e6c2fe090c10afcdc6e9f06764e6b4acba2070
MD5 e8302f54dbc596738a51b934d1c61185
BLAKE2b-256 c4e9a96c0c0cc8c22c873efc5e3725ed71fa46282c2aa298eccdc1b59295dc5f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.1.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 d35cd01c9cbc5d6ce07670e99aa8ac3fb55313e333409634693c5f57a264f773
MD5 14dea40d0f728c431c70ed4af8a5df05
BLAKE2b-256 eb766b5ae06a33021beeb808425bf7173cac2f3831684dbc1f09c957097089d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.1.2-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.2-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for medpython-1.1.2-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 dc29c90d032a74e7f980eeccd2a155fe3a16f5493b5346c242d4dc3c398cbc76
MD5 8b70fa5271a7259db7347e4fb7cdbdbe
BLAKE2b-256 34e1151dc914e9cb9da50cd3e8bafd86894412061d6bd39ec5c018e290ff2aca

See more details on using hashes here.

Provenance

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