Skip to main content

A Flexible Python Implementation of Targeted Estimation for Survival and Competing Risks Analysis

Project description

PyTMLE

PyTMLE is a flexible Python implementation of the Targeted Maximum Likelihood Estimation (TMLE) framework for survival and competing risks outcomes.

The package can be installed from PyPI, for example using pip:

pip install pytmle

It is designed to be easy to use with default models for initial estimates of nuisance functions which are applied in a super learner framework. With a pandas dataframe containing event times, indicators, and (binary) treatment group information in specified columns, it is straight-forward to fit a main PyTMLE class object and get predictions and plots for selected target_times:

from pytmle import PyTMLE

tmle = PyTMLE(df, 
              col_event_times="time", 
              col_event_indicator="status", 
              col_group="group", 
              target_times=target_times)

tmle.plot(type="risks") # get estimated counterfactual CIF, or set to "rr" or "rd" for ATE estimates based on RR or RD
pred = tmle.predict(type="risks") # store estimates in a data frame

However, it also allows for custom models to be used for the initial estimates or even passing initial estimates directly to the second TMLE stage.

Have a look at the package's Read the Docs page for the detailed API reference and tutorial notebooks.

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

pytmle-0.4.2.tar.gz (43.0 kB view details)

Uploaded Source

Built Distribution

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

pytmle-0.4.2-py3-none-any.whl (45.0 kB view details)

Uploaded Python 3

File details

Details for the file pytmle-0.4.2.tar.gz.

File metadata

  • Download URL: pytmle-0.4.2.tar.gz
  • Upload date:
  • Size: 43.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pytmle-0.4.2.tar.gz
Algorithm Hash digest
SHA256 b57fa784a887647e5fb8f1a981fdd268eefff201eb136429dc9a96ac5e7a4276
MD5 08f49cef00c9d1bd333036e080ebd3bc
BLAKE2b-256 b2e741f36e05fa19b732bfecfcd7b59df8a08710ceafa161ff26dc4b8cdafbe1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytmle-0.4.2.tar.gz:

Publisher: publish-to-pypi.yml on SCAI-BIO/pytmle

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

File details

Details for the file pytmle-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: pytmle-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 45.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pytmle-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 56be439cf39b1a0ececfb9ee1f77320bf8da772f8e4c23172df3c6be3beb1b50
MD5 4746542d9678ddb60dfdeb3dcd80f4e4
BLAKE2b-256 7202d84f9daf5f5298a9b38c38f87018d0c7c6b14bea59f17af95042ebf81b5a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytmle-0.4.2-py3-none-any.whl:

Publisher: publish-to-pypi.yml on SCAI-BIO/pytmle

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