Skip to main content

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.

Metadata

Release files for pytmle 0.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytmle 0.4.3
File Size Uploaded
pytmle-0.4.3.tar.gz 43.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytmle 0.4.3
File Interpreter ABI Platform
pytmle-0.4.3-py3-none-any.whl Python 3 none any Details

Total release size: 88.0 kB

Release files / pytmle-0.4.3.tar.gz

Download URL pytmle-0.4.3.tar.gz
Size 43.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7b0d4389bb0d1791cc7dadc1e062b7289edbe06af05a7268b2087c668d7abaac
BLAKE2b-256 checksum
How to use checksums
60708dac32d21274aae4e184f0999a2c3efea675e37a5484d7b4ba964178e8ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release files / pytmle-0.4.3-py3-none-any.whl

Download URL pytmle-0.4.3-py3-none-any.whl
Size 45.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5eeb13820801c853f1c5f667c1c0c0048d4ee4371cb340fd213e362d8921823d
BLAKE2b-256 checksum
How to use checksums
94959c16eab8301c070324b8fd3f5586dc62108c6824b9b5ecd480980e7b8ea5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release history Release notifications | RSS feed

0.6.0

2 release files

0.5.0

2 release files

This release

0.4.3 This release

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page