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.5.0

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.5.0
File Size Uploaded
pytmle-0.5.0.tar.gz 43.4 kB Details

Built distribution (wheel)

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

Total release size: 88.5 kB

Release files / pytmle-0.5.0.tar.gz

Download URL pytmle-0.5.0.tar.gz
Size 43.4 kB
Tags Source
SHA-256 checksum
How to use checksums
02f52cc06abed554931ff33abc6109ea791dcc59edc3205fe9f874396d86f8cc
BLAKE2b-256 checksum
How to use checksums
6a11a4baa7c22c3723b151934c83510172a2b8a4bed39fb85b9a5f7b9c12f24d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 27, 2026.

Transparency log

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

Download URL pytmle-0.5.0-py3-none-any.whl
Size 45.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c9626a4997d75a42f71af27067ee26590f0709d746a1e7a4bf68449d24ffcabf
BLAKE2b-256 checksum
How to use checksums
a0114d58d64c22ec7390937baa7186c4713180f77dad4808d0e651a8345f8fa1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 27, 2026.

Transparency log

Release history Release notifications | RSS feed

0.6.0

2 release files

This release

0.5.0 This release

2 release files

0.4.3

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