rtichoke
rtichoke is a Python library for visualizing the performance of predictive models. It provides a flexible and intuitive way to create a variety of common evaluation plots, including:
- ROC Curves
- Precision-Recall Curves
- Gains and Lift Charts
- Calibration Curves
- Decision Curves
The library is designed to be easy to use while still offering a high degree of control over the final plots.
For some reproducible examples please visit rtichoke blog!
Installation
For a project managed with uv, add rtichoke with:
uv add rtichoke
Alternatively, install rtichoke from PyPI with pip:
pip install rtichoke
Getting Started
To use rtichoke, you'll usually need two main inputs:
probs: A dictionary containing model-predicted probabilities.reals: Observed outcomes, provided either as one array or as a dictionary keyed by population.
Here's a quick example of creating a ROC curve for a single model:
import numpy as np
import rtichoke as rk
probs = {
"Model A": np.array([0.1, 0.9, 0.4, 0.8, 0.3, 0.7, 0.2, 0.6])
}
reals = {
"Population": np.array([0, 1, 0, 1, 0, 1, 0, 1])
}
fig = rk.create_roc_curve(
probs=probs,
reals=reals,
)
fig.show()
Compare populations
When predictions and outcomes are both dictionaries with the same keys, rtichoke pairs them population-by-population. The populations do not need to have the same sample size.
probs = {
"Train": np.array([0.10, 0.90, 0.20, 0.80, 0.30, 0.70]),
"Test": np.array([0.15, 0.85, 0.25, 0.75]),
}
reals = {
"Train": np.array([0, 1, 0, 1, 0, 1]),
"Test": np.array([0, 1, 0, 0]),
}
fig = rk.create_calibration_curve(
probs=probs,
reals=reals,
)
fig.show()
Here, Train contains six observations and Test contains four. Each probability vector only needs to match the outcome vector for its own population.
Key Features
- Simple API: Create complex visualizations with a small amount of code.
- Time-to-Event Analysis: Support for time-dependent outcomes, including censoring and competing risks.
- Interactive Plots: Plotly-based interactive visualizations.
- Flexible Data Handling: Works with common Python array/data-frame workflows, including NumPy and Polars.
Documentation
The official documentation, including the Getting Started guide and API reference, is published at:
Metadata
Release files for rtichoke 0.1.36
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| rtichoke-0.1.36.tar.gz | 228.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rtichoke-0.1.36-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 474.5 kB
Release files / rtichoke-0.1.36.tar.gz
| Download URL | rtichoke-0.1.36.tar.gz |
|---|---|
| Size | 228.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
da9b551488709da2389e4ef6b7b10630858b76d8c14633e90196e445b3219b5b
|
|
BLAKE2b-256 checksum How to use checksums |
3cc7f3283ba0f56d2c3f8e03f8d6ffdf2d21deea5142f045c23d0070b951aefb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / rtichoke-0.1.36-py3-none-any.whl
| Download URL | rtichoke-0.1.36-py3-none-any.whl |
|---|---|
| Size | 245.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3add918e447693d9d8116d680d3c6614086ba1524c0c22921b86ee6ea054ec7b
|
|
BLAKE2b-256 checksum How to use checksums |
52ecfced5ac016aa6d7873009d2b3ff9b5558f8663f6f7b46e7ebec0f39e4b30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for rtichoke 0.1.36
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.