Skip to main content

A module for evaluating the predictions of the models trained on MEDS datasets.

Project description

MEDS Evaluation

PyPI - Version python tests code-quality hydra license PRs contributors

This package provides an evaluation API for models produced in the MEDS ecosystem. If predictions are produced in accordance with the provided pyarrow schema, this package can be used to evaluate a model's performance in a consistent, Health-AI focused manner.

To use, simply:

  1. Install: pip install meds-evaluation
  2. Produce predictions that satisfy the included schema.
  3. Run the meds-evaluation-cli tool: meds-evaluation-cli predictions_path="$PREDICTIONS_FP_GLOB" output_dir="$OUTPUT_DIR"

A JSON file with the output evaluations will be produced in the given dir!

[!NOTE] This is a work-in-progress package and currently only supports evaluation of binary classification tasks.

Prediction schema

Inputs to MEDS Evaluation must follow the prediction schema, which by default has five fields:

  1. subject_id: ID of the subject (patient) associated with the event
  2. prediction_time: time at which the prediction as being made
  3. boolean_value: ground truth boolean label for the prediction task
  4. predicted_boolean_value (optional): predicted boolean label generated by the model
  5. predicted_boolean_probability (optional): predicted probability logits generated by the model

This is equivalent to the following polars schema:

Schema(
    [
        ("subject_id", Int64),
        ("prediction_time", Datetime(time_unit="us")),
        ("boolean_value", Boolean),
        ("predicted_boolean_value", Boolean),
        ("predicted_boolean_probability", Float64),
    ]
)

Note that while predicted_boolean_value and predicted_boolean_probability are optional, at least one of them must be present and contain non-null values in order to generate the results. In addition, a schema can contain additional fields but at the moment these will not be used in MEDS Evaluation.

MEDS Ecosystem

MEDS Evaluation pipeline is intended to be used together with MEDS-DEV, but can also be adapted to use as a standalone package.

Please refer to the MEDS-DEV tutorial to learn how to extract and prepare the data in the MEDS format and obtain model predictions ready to be evaluated.

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

meds_evaluation-0.0.3.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

meds_evaluation-0.0.3-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file meds_evaluation-0.0.3.tar.gz.

File metadata

  • Download URL: meds_evaluation-0.0.3.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for meds_evaluation-0.0.3.tar.gz
Algorithm Hash digest
SHA256 586d5f0b27823fef91e59e1f94744ee52fe64932ca73be2ff4c321aff2ab5bfb
MD5 051590effdd1722e242fdba12721d9c3
BLAKE2b-256 defc44a77a8cfee1e88f039eb5cd460fec917f4a338e9106dda791605931e556

See more details on using hashes here.

Provenance

The following attestation bundles were made for meds_evaluation-0.0.3.tar.gz:

Publisher: publish-to-pypi.yaml on kamilest/meds-evaluation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file meds_evaluation-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for meds_evaluation-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fb63459b293634bb6e26c0c1ae097e7c22865eb0ba251e7b137a3cb2b9a63035
MD5 b057dbbfdcd581538e3fccace77a7859
BLAKE2b-256 58fcd3ca372b9d0724eb334dc7f50676ba8f12c30bc3c35be17178f28313f2c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for meds_evaluation-0.0.3-py3-none-any.whl:

Publisher: publish-to-pypi.yaml on kamilest/meds-evaluation

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