Skip to main content

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:

https://uriahf.github.io/rtichoke_python/

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rtichoke-0.1.34.tar.gz (223.5 kB view details)

Uploaded Source

Built Distribution

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

rtichoke-0.1.34-py3-none-any.whl (238.2 kB view details)

Uploaded Python 3

File details

Details for the file rtichoke-0.1.34.tar.gz.

File metadata

  • Download URL: rtichoke-0.1.34.tar.gz
  • Upload date:
  • Size: 223.5 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for rtichoke-0.1.34.tar.gz
Algorithm Hash digest
SHA256 752b27cfc456ea20d86a4adb4f8216d39ad31743ec5e833d60e147d4afa76ecb
MD5 fc83e571bef90e2744a2679b95d2dd1f
BLAKE2b-256 09c4ae2f49bb1f6e1f39b5c0ffca36f5175319cdaf080668d8684e46aeefb888

See more details on using hashes here.

File details

Details for the file rtichoke-0.1.34-py3-none-any.whl.

File metadata

  • Download URL: rtichoke-0.1.34-py3-none-any.whl
  • Upload date:
  • Size: 238.2 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for rtichoke-0.1.34-py3-none-any.whl
Algorithm Hash digest
SHA256 f9194bd1a5fd5d6eaf69a1357aace72630c586e583b53f4c670c9266a26e82cd
MD5 3b97bae8ba39d21afaaeae20eeacd40d
BLAKE2b-256 5a228222444478fc4aa8f1289341abb5d9e208863f49afca950fe61027303ecd

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.36

2 files

0.1.35

2 files

This release

0.1.34 This release

2 files

0.1.33

2 files

0.1.30

2 files

0.1.29

2 files

0.1.28

2 files

0.1.27

2 files

0.1.26

2 files

0.1.25

2 files

0.1.24

2 files

0.1.23

2 files

0.1.22

2 files

0.1.21

2 files

0.1.20

2 files

0.1.18

2 files

0.1.17

2 files

0.1.16

2 files

0.1.15

2 files

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

1 file

0.1.8

1 file

0.1.7

1 file

0.1.6

1 file

0.1.5

1 file

0.1.4

1 file

0.1.3

1 file

0.1.1

1 file

0.1.0

1 file

0.0.1

2 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