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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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