Skip to main content

Framework for Electronic Medical Records. A python package for building models using EHR data.

Project description

FEMR

Framework for Electronic Medical Records

FEMR is a Python package for manipulating longitudinal EHR data for machine learning, with a focus on supporting the creation of foundation models and verifying their presumed benefits in healthcare. Such a framework is needed given the current state of large language models in healthcare and the need for better evaluation frameworks.

The currently supported foundation models are CLMBR and MOTOR.

FEMR works with data that has been converted to the MEDS schema, a simple schema that supports a wide variety of EHR / claims datasets. Please see the MEDS documentation, and in particular its provided ETLs for help converting your data to MEDS.

FEMR helps users:

  1. Use ontologies to better understand / featurize medical codes
  2. Algorithmically label patient records based on structured data
  3. Generate tabular features from patient timelines for use with traditional gradient boosted tree models
  4. Train and finetune CLMBR-derived models for binary classification and prediction tasks.
  5. Train and finetune MOTOR-derived models for binary classification and prediction tasks.

We recommend users start with our tutorial folder

Installation

FEMR can be installed with the simple command pip install femr.

If you are using deep learning, you need to also install xformers pip install xformers.

Getting Started

The first step of using FEMR is to convert your patient data into MEDS, the standard input format expected by FEMR codebase.

The best way to do this is with the ETLs provided by MEDS.

Development

The following guides are for developers who want to contribute to FEMR.

Precommit checks

Before committing, please run the following commands to ensure that your code is formatted correctly and passes all tests.

Installation

conda install pre-commit pytest -y
pre-commit install

Running

Test Functions

pytest tests

Formatting Checks

pre-commit run --all-files

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

femr-0.2.3.tar.gz (787.7 kB view details)

Uploaded Source

Built Distribution

femr-0.2.3-py3-none-any.whl (55.4 kB view details)

Uploaded Python 3

File details

Details for the file femr-0.2.3.tar.gz.

File metadata

  • Download URL: femr-0.2.3.tar.gz
  • Upload date:
  • Size: 787.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for femr-0.2.3.tar.gz
Algorithm Hash digest
SHA256 0fcfafe0175711745c86e096bdbbdbc5688689f5cec59f07d32e5ce50e0bd0e3
MD5 7f1602d90f5e50fbe94e37517bb2729c
BLAKE2b-256 fea22e5c5ab7b6500ba5ffcdff65f82243e6bf956f62b8d56f9c9449a6902f47

See more details on using hashes here.

File details

Details for the file femr-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: femr-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 55.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for femr-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ca1446a454d560a3daa896a65e9b98f22182f4a9066ae533ee575884e50f18cd
MD5 e7cda1a04ba76f90c113d6153a3c59d3
BLAKE2b-256 49caba3773e80ee975a1f8727dece5ab21cf6adabe73d2a7edf992dfa133dd5f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page