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.
  • State of The Art Algorithms Developed state of the art algorithms for EMR use cases, explainablity and 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 ✅ Pre-built (Py 3.10-3.13) 🛠️ Compile Required

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.0.6.tar.gz (56.8 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.0.6-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (43.4 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

medpython-1.0.6-cp313-cp313-win_amd64.whl (40.1 MB view details)

Uploaded CPython 3.13Windows x86-64

medpython-1.0.6-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (43.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

medpython-1.0.6-cp313-cp313-macosx_15_0_x86_64.whl (37.6 MB view details)

Uploaded CPython 3.13macOS 15.0+ x86-64

medpython-1.0.6-cp312-cp312-win_amd64.whl (40.1 MB view details)

Uploaded CPython 3.12Windows x86-64

medpython-1.0.6-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (43.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

medpython-1.0.6-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (42.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

medpython-1.0.6-cp312-cp312-macosx_15_0_x86_64.whl (37.6 MB view details)

Uploaded CPython 3.12macOS 15.0+ x86-64

medpython-1.0.6-cp311-cp311-win_amd64.whl (40.1 MB view details)

Uploaded CPython 3.11Windows x86-64

medpython-1.0.6-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (43.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

medpython-1.0.6-cp311-cp311-macosx_15_0_x86_64.whl (37.6 MB view details)

Uploaded CPython 3.11macOS 15.0+ x86-64

medpython-1.0.6-cp310-cp310-win_amd64.whl (40.1 MB view details)

Uploaded CPython 3.10Windows x86-64

medpython-1.0.6-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (43.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

medpython-1.0.6-cp310-cp310-macosx_15_0_x86_64.whl (37.6 MB view details)

Uploaded CPython 3.10macOS 15.0+ x86-64

File details

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

File metadata

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

File hashes

Hashes for medpython-1.0.6.tar.gz
Algorithm Hash digest
SHA256 d4adf6de379e399f49f4ab0600e53d4a6c4882cafac7b0f8a02aea0fb210907b
MD5 6c71aeb70e6a2b25ffc3364a05c808b9
BLAKE2b-256 076a6c5da3e6ae3bee73867ce6a2c8df239c84513ac9fd718eba9eb239f6027d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.0.6-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 5e4b33ef1d08e38be224475e974501d65cd278c6776393541494feb13626df76
MD5 e248944478bee58b57ffa29f8bee1a6f
BLAKE2b-256 bc233853950f23b9333d250986c097a7fe53c1a99f95aea5f27a32feeac54820

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: medpython-1.0.6-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 40.1 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.0.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a5c51dac640aa8a889f4c7c8fd718dad69804b0d284e233638fc23cba9988ee8
MD5 24eff11ab5b0a56300af27a28201ddd0
BLAKE2b-256 9984fb381f774d92aa12c66477a8e92c695acd1ead3375b2bb0a6c0b16ddf927

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.0.6-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 aaa58537e716c9e2a848e5780137a2b6bccee1529990b295710919967ee1f340
MD5 9938535449ded45e98503475dcee48ce
BLAKE2b-256 15d3d9138b0f0989dc7247cdd7300a6455f2e03032b159485f7e3dc07541e423

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.0.6-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.0.6-cp313-cp313-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for medpython-1.0.6-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 781bfec22cfac8e52a00c29447fd0d1c1a6f6786246a81a45d2834c080c4a894
MD5 48b76a08fc779636e55706c76241c818
BLAKE2b-256 9eaf06dc90f2e0d75b85879edb59f43712d00b46d3c673d1db0bf9cdc5bfcaba

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.0.6-cp313-cp313-macosx_15_0_x86_64.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.0.6-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: medpython-1.0.6-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 40.1 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.0.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0cb95b723fe26577e952890e5ddd8bf2a081a2cdf5e021cf2fd5a81de70606f8
MD5 af3794b256f6efa269c519b67fc59c79
BLAKE2b-256 d1daed7a16c543e6337cde4f07ebc95eea02c9afc49751f344cb89bb20d4ccc6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.0.6-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 da04b551010ff43bb19c9f5438ac138148cede33657f0f1af6b1b649c028bb95
MD5 965d0ee5b43c05265d9dc70a4ebcf5d9
BLAKE2b-256 5adb16541c3017d9e3e59c7e42bf0997791317ecce6b046d14fa7bab9992a47b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.0.6-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 d3e712235dc76ddd65725d75eb2a97176dd175a1f85ad4cd888ba5b1d93b4e6d
MD5 9d656d2f5be36ade00d7ea09843c4e6a
BLAKE2b-256 dc3220beb561334c1722201f386e2838f759e0de1e75a485b31cce8ac4515313

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.0.6-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.0.6-cp312-cp312-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for medpython-1.0.6-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 432624e4eb019925fdbbdaf5f95b428c087bae42fc75938cdab193fb99084964
MD5 c9bba2be735b56b0894a25d15bbd36a7
BLAKE2b-256 61be19a98ea881acbedb8a9b43996c2ea47fd5a47ff4d0ae03cff49bf9caffd8

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.0.6-cp312-cp312-macosx_15_0_x86_64.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.0.6-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: medpython-1.0.6-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 40.1 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.0.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 8ff276ad6b6e03545662d4e7633351016ba43c9fbcd074c824ecb5ab03fc5ef8
MD5 19a7eb816443f98758a76e475e394071
BLAKE2b-256 e42b34de85c2f2d011920ed122fff622789520b227612cb805527ce3fb0565c8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.0.6-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 c97a9b338086702e09598a2c49495b9c32d6f36e8df7360d04ce944bcdaa0137
MD5 57d0d09ba2ba23d11cc2d09196842dac
BLAKE2b-256 b2097599d11b0a5c9cd4a28880e092b4a2155a8ee3b8e68da8b7e4298fade3af

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.0.6-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.0.6-cp311-cp311-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for medpython-1.0.6-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 c1af1de0af4d9e7333c8f3309ce42d6a7d5516b87578a254a0c6b548e4c7739a
MD5 a7c3aa1444cd98877ecca15ef9811f56
BLAKE2b-256 d18e89a1ecc1bace8f6416e224489b36998a2bd5b15dab6fa1dc770bd9637eaf

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.0.6-cp311-cp311-macosx_15_0_x86_64.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.0.6-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: medpython-1.0.6-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 40.1 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.0.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6daf7e76f650e4f62a689b5e71067dee932c3320caba27f52e1a1af677bed541
MD5 3efcd44db4820a83ca698471ee86ab97
BLAKE2b-256 ba74d7691a1ba9acaf7ea8b19abcde1646ed29a0c8ce0e2f4bd6101b37f8e9f1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.0.6-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 ccad08796d657232afb9a42f2a494f942b7fcec6d2cbc4a8390d1b7104812461
MD5 75476c81a2db480ee378aa4722f5114c
BLAKE2b-256 b047f0fee8ef22163f1649832dffa1100f72e4ea199551c4830978b3a65f7cd2

See more details on using hashes here.

Provenance

The following attestation bundles were made for medpython-1.0.6-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.0.6-cp310-cp310-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for medpython-1.0.6-cp310-cp310-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 0c6326984bd4b9a5d9e70b68e380aa709de30e5b486618173d358c7ed6233d46
MD5 bca181ee0883a7bd9ca08cba66a353d8
BLAKE2b-256 202932dc7f1fb46aa0bf42e012f4344b440cd7c02057591f87919ee15de6eb49

See more details on using hashes here.

Provenance

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