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.

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

System Requirements

  • Supported Systems: This pre-built version is available for modern Linux distributions (specifically manylinux2014 equivalents, such as CentOS >= 7 or Ubuntu >= 13.04). The software also compiles in Windows, Alpine and Mac but you will need to install Boost yourself. I hope shortly to provide windows/macos pre-compiled builds.
  • Python: Requires Python 3.10 through 3.14

Compilation for Other Systems If you're using an older Linux or a different platform/Python version >= 3.8, or a version without a pre-build, you will need to compile the package yourself. 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.5.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.5-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (44.1 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

medpython-1.0.5-cp313-cp313-win_amd64.whl (40.3 MB view details)

Uploaded CPython 3.13Windows x86-64

medpython-1.0.5-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (44.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

medpython-1.0.5-cp313-cp313-macosx_15_0_x86_64.whl (37.9 MB view details)

Uploaded CPython 3.13macOS 15.0+ x86-64

medpython-1.0.5-cp312-cp312-win_amd64.whl (40.2 MB view details)

Uploaded CPython 3.12Windows x86-64

medpython-1.0.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (44.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

medpython-1.0.5-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (43.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

medpython-1.0.5-cp312-cp312-macosx_15_0_x86_64.whl (37.9 MB view details)

Uploaded CPython 3.12macOS 15.0+ x86-64

medpython-1.0.5-cp311-cp311-win_amd64.whl (40.3 MB view details)

Uploaded CPython 3.11Windows x86-64

medpython-1.0.5-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (44.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

medpython-1.0.5-cp311-cp311-macosx_15_0_x86_64.whl (37.9 MB view details)

Uploaded CPython 3.11macOS 15.0+ x86-64

medpython-1.0.5-cp310-cp310-win_amd64.whl (40.3 MB view details)

Uploaded CPython 3.10Windows x86-64

medpython-1.0.5-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (44.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

medpython-1.0.5-cp310-cp310-macosx_15_0_x86_64.whl (37.9 MB view details)

Uploaded CPython 3.10macOS 15.0+ x86-64

File details

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

File metadata

  • Download URL: medpython-1.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 f534712dcc193da8d029ee90fe6d4a7159db3fe99ad425bd9e9adf60d465a28c
MD5 16e88bffc1fd997858a788b487c6b0dd
BLAKE2b-256 192f328351a88bd5dfe8357b38facefce3048add42597e135b63dc69d3dec50c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.0.5-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 4f1d5f0ccd10126a9b63762a2acc6cd6d627f0c9393d08d48b0e317038999632
MD5 98b8205b8d7148d2ec2df885bc2e570a
BLAKE2b-256 b26d4690646a6d83c694f2f974d6d012dab51f89eb70b9909092943d0778b508

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: medpython-1.0.5-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 40.3 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.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5fd81476d90093796a07bdf22e0d717938d8ae816ebc741141969132fe370369
MD5 e77989b313f3960248168c6ddd317f1f
BLAKE2b-256 0e15fd7cf96fefa08ee61f59775a918bd089c0c8e5131ef678e4d403537ba420

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.0.5-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 5a1fbc1743ebfcd2e611fc928d340678d45a16d41e309d41b186ba53647494c4
MD5 8500a59c4d7213f53e41549991d5614f
BLAKE2b-256 22aac4464d5b7085ba19b6ae7ecb4ccab3e8ebe62535ecea1aefb6cf184ad25b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.0.5-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 20fe029a5c0373f6ebf412e08dbfe69ab04523869f6792ea9acda4934bece338
MD5 928cf24f048701ab3bb064636a71bf79
BLAKE2b-256 62f053d56d17422d317df5fed233ef1e9466ed87f60f3d738991ea8027ae8e09

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: medpython-1.0.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 40.2 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.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f666f51617d1cd2e1d287f169712c809fa494ee61dc3ba944158aba5b6a8ef6b
MD5 2fd873a5796d67368f8249420c52dd2a
BLAKE2b-256 26fb8b5f49dc81f45ed9f4f6974cd56c6e358210dffc24381a94f6814bc673fc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.0.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 dd409253112d76115dd75f85622afc83ebff0c553b0e91bcc3a9aa63c1bcc80f
MD5 25c28782259f8181b3a833f642c78c19
BLAKE2b-256 e6bd11deff9b378eb5713c134a378e0c269da67fd47841dcde80094eab02c3ed

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.0.5-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 072ccbda1e3608838ecaebd7aa67875c2840a936eb8fab468c79763e06769c1c
MD5 8899be64c7016c949038d3891e02a289
BLAKE2b-256 75eb705e123d598d6100988952ac4fc0482653598736f61cd2082703a872b7f0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.0.5-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 c31f85ef2f7d713e52788e70be694bef98ddd5dfaf34c00d96e475e90bf3269b
MD5 42a88fbb8ce7859ba54d2defdcbd799b
BLAKE2b-256 eee704ca5cbda7797ac659852b575393684e1b8160da32b2cf06c3d5b87979b1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: medpython-1.0.5-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 40.3 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.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f939766e10fded39d8674e2649e0c0ae7c2836d135c6eacee5a489e6c26930e5
MD5 da526c6d1d0e43af6a3795f5f5c302bf
BLAKE2b-256 5c054a883e483d8eed29c2a07fca78dbaf29c7a94170971f101c397808b2e165

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.0.5-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 164d28c4c6d0e0fbe04f9e3144e5f4b7e1875646ee953142b0b10aff4dd6cae4
MD5 50121a79a042b0bd96c4368cc228bbe0
BLAKE2b-256 abf785986944c824698fc85560af99f5913ab331f682ca3efa4fb999ab673420

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.0.5-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 229ee693ac629d9cfed313cf014c5651d3100f7d667c69e5d4b8b697842ab21f
MD5 ed12f610c36c6c41c104af002a3a3d17
BLAKE2b-256 695f41b48e09aea3e50608b02245915eaee0854ca74406a22e8659658b984cfb

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: medpython-1.0.5-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 40.3 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.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 52f7d7fbb5f46a509351f49657f0b7ff9c8bacdd106c63c16190c7acc2aa253d
MD5 adc36910ad215495171fcb786feac81d
BLAKE2b-256 a9f69df0de3fe20db7a600e752db401b77cde29c01ca0355834b78f34ef273db

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.0.5-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 f74bff8a92616bd7d0d6c8f0da50169c0d95f25e4803a4f9ea95796051925c07
MD5 e332de927aa1f73041bdd74fc4aeed8e
BLAKE2b-256 d6f668cfe65a360493e621641072f7477cabb290362e7b9679e203f7d731fea4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for medpython-1.0.5-cp310-cp310-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 d5f710423f479241dafdee0b9cd39a91e41050d0531e4277f8716fa20428c52a
MD5 3537a34ad56c787740ebd22e8bc95170
BLAKE2b-256 605dd1e2a941fa9a3d2373b45ded8205d98427a920d154d8fda66e6f8737a216

See more details on using hashes here.

Provenance

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